AttributeCompileErrors.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __AttributeDetailCompileErrors_h__
00041 #define __AttributeDetailCompileErrors_h__
00042
00043 #include <stdint.h>
00044
00045 #include "assert/static.h"
00046
00047 #include "boost/mpl/int.hpp"
00048
00049 namespace famouso {
00050 namespace mw {
00051 namespace attributes {
00052 namespace detail {
00053
00060 template <uint16_t seqSize>
00061 struct ExtendedSequenceBoundError {
00062 typedef ExtendedSequenceBoundError type;
00063
00064
00065
00066 FAMOUSO_STATIC_ASSERT_ERROR(
00067 ((seqSize & 0x7FFF) == seqSize),
00068 sequence_length_exceeds_extended_format_bounds,
00069 (boost::mpl::int_<seqSize>));
00070 };
00071
00078 template <uint16_t seqSize>
00079 struct UnextendedSequenceBoundError {
00080 typedef UnextendedSequenceBoundError type;
00081
00082
00083
00084 FAMOUSO_STATIC_ASSERT_ERROR(
00085 ((seqSize & 0x7F) == seqSize),
00086 sequence_length_exceeds_unextended_format_bounds,
00087 (boost::mpl::int_<seqSize>));
00088 };
00089
00095 template <bool isRequirable, typename RelatedAttr, typename Requirement, bool compileError>
00096 struct AttributeIsNotRequireable {
00097 typedef AttributeIsNotRequireable type;
00098
00099 FAMOUSO_STATIC_ASSERT(
00100 isRequirable,
00101 only_requirable_attributes_may_be_used_in_a_requirement,
00102 (RelatedAttr, Requirement),
00103 compileError);
00104 };
00105
00111 template <bool contained, typename RelatedAttr, typename Provision, bool compileError>
00112 struct RequiredAttributeNotContainedInProvision {
00113 typedef RequiredAttributeNotContainedInProvision type;
00114
00115 FAMOUSO_STATIC_ASSERT(
00116 contained,
00117 required_attribute_not_contained_in_provision,
00118 (RelatedAttr, Provision),
00119 compileError);
00120 };
00121
00127 template <bool valueFits, typename RelatedAttr, typename ProvAttr, bool compileError>
00128 struct RequiredValueNotProvided {
00129 typedef RequiredValueNotProvided type;
00130
00131 FAMOUSO_STATIC_ASSERT(
00132 valueFits,
00133 required_value_not_provided,
00134 (RelatedAttr, ProvAttr),
00135 compileError);
00136 };
00137 }
00138 }
00139 }
00140 }
00141 #endif
00142