• Home
  • Raw
  • Download

Lines Matching refs:S

38     template<typename S, typename=decltype(S() == S())>
43 template<typename S, typename=decltype(S() != S())>
54 template<typename S>
56 : public std::integral_constant<bool, decltype(_C2Comparable_impl::TestEqual<S>(0))::value
57 || decltype(_C2Comparable_impl::TestNotEqual<S>(0))::value> {
63 template<typename S, int=S::CORE_INDEX>
76 template<typename S, int CoreIndex>
77 struct C2_HIDE _C2AddCoreIndex : public S {
88 template<typename S, int CoreIndex, unsigned TypeFlags>
91 std::is_default_constructible<S>::value, "C2 structure must have default constructor");
92 static_assert(!std::is_polymorphic<S>::value, "C2 structure must not have virtual methods");
93 static_assert(!_C2Comparable<S>::value, "C2 structure must not have operator== or !=");
109 template<typename S, unsigned=S::FLEX_SIZE>
116 template<typename S>
118 : public std::integral_constant<bool, decltype(_C2Flexible_impl::TestFlexSize<S>(0))::value> {
122 #define IF_FLEXIBLE(S) ENABLE_IF(_C2Flexible<S>::value) argument
132 template<typename S, typename E=void>
139 template<typename S>
140 struct C2_HIDE _C2FlexHelper<S,
141 typename _c2_enable_if_type<typename S::_FlexMemberType>::type> {
142 typedef typename _C2FlexHelper<typename S::_FlexMemberType>::FlexType FlexType;
143 enum : uint32_t { FLEX_SIZE = _C2FlexHelper<typename S::_FlexMemberType>::FLEX_SIZE };
147 template<typename S>
148 struct C2_HIDE _C2FlexHelper<S[],
149 typename std::enable_if<std::is_void<typename _C2FlexHelper<S>::FlexType>::value>::type> {
150 typedef S FlexType;
151 enum : uint32_t { FLEX_SIZE = sizeof(S) };
163 template<typename S, int ParamIndex, unsigned TypeFlags>
166 public _C2StructCheck<S, ParamIndex | C2Param::CoreIndex::IS_FLEX_FLAG, TypeFlags> {
173 inline static const std::vector<C2FieldDescriptor> FieldList() { return S::FieldList(); }
180 _C2FlexStructCheck(const _C2FlexStructCheck<S, ParamIndex, TypeFlags> &) = delete;
181 _C2FlexStructCheck& operator= (const _C2FlexStructCheck<S, ParamIndex, TypeFlags> &) = delete;
186 FLEX_SIZE = _C2FlexHelper<S>::FLEX_SIZE, ///< size of flexible type
190 BASE_SIZE = sizeof(S) + sizeof(C2Param), ///< size of the base param
195 if (flexCount <= (MAX_SIZE - size) / S::FLEX_SIZE) {
196 return size + S::FLEX_SIZE * flexCount;
239 #define DEFINE_FLEXIBLE_ALLOC(_Type, S, ptr, Ptr) \
244 template<typename ...Args, typename U=typename S::FlexType> \
249 template<typename ...Args, typename U=typename S::FlexType> \
254 template<typename ...Args, typename U=typename S::FlexType, unsigned N> \
262 #define DEFINE_FLEXIBLE_METHODS(_Type, S) \
263 DEFINE_FLEXIBLE_ALLOC(_Type, S, shared, Shared) \
264 DEFINE_FLEXIBLE_ALLOC(_Type, S, unique, Unique) \
310 template<typename T, typename S, int ParamIndex=S::CORE_INDEX, class Flex=void>
311 struct C2_HIDE C2GlobalParam : public T, public S,
312 public _C2StructCheck<S, ParamIndex, T::PARAM_KIND | T::Type::DIR_GLOBAL> {
315 typedef C2GlobalParam<T, S, ParamIndex> _Type;
320 … inline C2GlobalParam(const Args(&... args)) : T(sizeof(_Type), _Type::PARAM_TYPE), S(args...) { }
340 template<typename T, typename S, int ParamIndex>
341 struct C2_HIDE C2GlobalParam<T, S, ParamIndex, IF_FLEXIBLE(S)>
342 : public T, public _C2FlexStructCheck<S, ParamIndex, T::PARAM_KIND | T::Type::DIR_GLOBAL> {
344 typedef C2GlobalParam<T, S, ParamIndex> _Type;
352 S m; ///< wrapped flexible structure
354 DEFINE_FLEXIBLE_METHODS(_Type, S)
377 template<typename T, typename S, int ParamIndex=S::CORE_INDEX, class Flex=void>
378 struct C2_HIDE C2PortParam : public T, public S,
379 private _C2StructCheck<S, ParamIndex, T::PARAM_KIND | T::Index::DIR_UNDEFINED> {
382 typedef C2PortParam<T, S, ParamIndex> _Type;
390 : T(sizeof(_Type), _output ? output::PARAM_TYPE : input::PARAM_TYPE), S(args...) { }
397 struct input : public T, public S,
398 public _C2StructCheck<S, ParamIndex, T::PARAM_KIND | T::Index::DIR_INPUT> {
402 inline input(const Args(&... args)) : T(sizeof(_Type), input::PARAM_TYPE), S(args...) { }
409 struct output : public T, public S,
410 public _C2StructCheck<S, ParamIndex, T::PARAM_KIND | T::Index::DIR_OUTPUT> {
414 inline output(const Args(&... args)) : T(sizeof(_Type), output::PARAM_TYPE), S(args...) { }
439 template<typename T, typename S, int ParamIndex>
440 struct C2_HIDE C2PortParam<T, S, ParamIndex, IF_FLEXIBLE(S)>
441 : public T, public _C2FlexStructCheck<S, ParamIndex, T::PARAM_KIND | T::Type::DIR_UNDEFINED> {
443 typedef C2PortParam<T, S, ParamIndex> _Type;
457 S m; ///< wrapped flexible structure
459 DEFINE_FLEXIBLE_METHODS(_Type, S)
464 public _C2FlexStructCheck<S, ParamIndex, T::PARAM_KIND | T::Index::DIR_INPUT> {
472 S m; ///< wrapped flexible structure
474 DEFINE_FLEXIBLE_METHODS(input, S)
480 public _C2FlexStructCheck<S, ParamIndex, T::PARAM_KIND | T::Index::DIR_OUTPUT> {
488 S m; ///< wrapped flexible structure
490 DEFINE_FLEXIBLE_METHODS(output, S)
516 template<typename T, typename S, int ParamIndex=S::CORE_INDEX, class Flex=void>
517 struct C2_HIDE C2StreamParam : public T, public S,
518 private _C2StructCheck<S, ParamIndex,
522 typedef C2StreamParam<T, S, ParamIndex> _Type;
532 S(args...) { }
541 struct input : public T, public S,
542 public _C2StructCheck<S, ParamIndex,
551 : T(sizeof(_Type), input::PARAM_TYPE, stream), S(args...) { }
559 struct output : public T, public S,
560 public _C2StructCheck<S, ParamIndex,
569 : T(sizeof(_Type), output::PARAM_TYPE, stream), S(args...) { }
598 template<typename T, typename S, int ParamIndex>
599 struct C2_HIDE C2StreamParam<T, S, ParamIndex, IF_FLEXIBLE(S)>
601 public _C2FlexStructCheck<S, ParamIndex,
604 typedef C2StreamParam<T, S, ParamIndex> _Type;
615 S m; ///< wrapped flexible structure
622 DEFINE_FLEXIBLE_METHODS(_Type, S)
627 public _C2FlexStructCheck<S, ParamIndex,
638 S m; ///< wrapped flexible structure
643 DEFINE_FLEXIBLE_METHODS(input, S)
649 public _C2FlexStructCheck<S, ParamIndex,
660 S m; ///< wrapped flexible structure
665 DEFINE_FLEXIBLE_METHODS(output, S)