Lines Matching refs:T

126 template<typename T, typename V=void>
217 (_Type::PARAM_TYPE & T::Index::DIR_UNDEFINED) != T::Index::DIR_UNDEFINED); \
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;
349 : T(_Type::CalcSize(flexCount), _Type::PARAM_TYPE), m(flexCount, args...) { }
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;
386 inline C2PortParam() : T(sizeof(_Type), _Type::PARAM_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;
446 inline C2PortParam(size_t flexCount) : T(_Type::CalcSize(flexCount), _Type::PARAM_TYPE) { }
450 : T(_Type::CalcSize(flexCount), _output ? output::PARAM_TYPE : input::PARAM_TYPE),
463 struct input : public T,
464 public _C2FlexStructCheck<S, ParamIndex, T::PARAM_KIND | T::Index::DIR_INPUT> {
469 : T(_Type::CalcSize(flexCount), input::PARAM_TYPE), m(flexCount, args...) { }
479 struct output : public T,
480 public _C2FlexStructCheck<S, ParamIndex, T::PARAM_KIND | T::Index::DIR_OUTPUT> {
485 : T(_Type::CalcSize(flexCount), output::PARAM_TYPE), m(flexCount, args...) { }
516 template<typename T, typename S, int ParamIndex=S::CORE_INDEX, class Flex=void>
517 struct C2_HIDE C2StreamParam : public T, public S,
519 T::PARAM_KIND | T::Index::IS_STREAM_FLAG | T::Index::DIR_UNDEFINED> {
522 typedef C2StreamParam<T, S, ParamIndex> _Type;
526 inline C2StreamParam() : T(sizeof(_Type), _Type::PARAM_TYPE) { }
531 : T(sizeof(_Type), _output ? output::PARAM_TYPE : input::PARAM_TYPE, stream),
541 struct input : public T, public S,
543 T::PARAM_KIND | T::Index::IS_STREAM_FLAG | T::Type::DIR_INPUT> {
547 inline input() : T(sizeof(_Type), input::PARAM_TYPE) { }
551 : T(sizeof(_Type), input::PARAM_TYPE, stream), S(args...) { }
559 struct output : public T, public S,
561 T::PARAM_KIND | T::Index::IS_STREAM_FLAG | T::Type::DIR_OUTPUT> {
565 inline output() : T(sizeof(_Type), output::PARAM_TYPE) { }
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)>
600 : public T,
602 T::PARAM_KIND | T::Index::IS_STREAM_FLAG | T::Index::DIR_UNDEFINED> {
604 typedef C2StreamParam<T, S, ParamIndex> _Type;
606 … inline C2StreamParam(size_t flexCount) : T(_Type::CalcSize(flexCount), _Type::PARAM_TYPE, 0u) { }
611 : T(_Type::CalcSize(flexCount), _output ? output::PARAM_TYPE : input::PARAM_TYPE, stream),
626 struct input : public T,
628 T::PARAM_KIND | T::Index::IS_STREAM_FLAG | T::Type::DIR_INPUT> {
631 inline input(size_t flexCount) : T(_Type::CalcSize(flexCount), input::PARAM_TYPE) { }
635 : T(_Type::CalcSize(flexCount), input::PARAM_TYPE, stream), m(flexCount, args...) { }
648 struct output : public T,
650 T::PARAM_KIND | T::Index::IS_STREAM_FLAG | T::Type::DIR_OUTPUT> {
653 inline output(size_t flexCount) : T(_Type::CalcSize(flexCount), output::PARAM_TYPE) { }
657 : T(_Type::CalcSize(flexCount), output::PARAM_TYPE, stream), m(flexCount, args...) { }
676 template<typename T>
678 T value; ///< simple value of the structure
682 inline C2SimpleValueStruct(T value) : value(value) {}
690 template<typename T>
696 …virtual const T *data() const = 0; // TODO: should this be friend access only in some C2Memory mod…
699 inline T *data() { return const_cast<T*>(const_cast<const C2MemoryBlock*>(this)->data()); }
709 template<typename T>
710 struct C2ConstMemoryBlock : public C2MemoryBlock<T> {
711 virtual const T * data() const { return _mData; }
716 inline constexpr C2ConstMemoryBlock(const T(&init)[N]) : _mData(init), _mSize(N) {}
719 const T *_mData;
731 template<typename T>
732 static void init(T(&array)[], size_t arrayLen, const C2MemoryBlock<T> &block) {
734 if (arrayLen && std::is_same<T, char>::value) {
738 memcpy(array, block.data(), std::min(arrayLen, block.size()) * sizeof(T));
743 template<typename T>
744 static void init(T(&array)[], size_t arrayLen, const std::initializer_list<T> &init) {
747 if (arrayLen && std::is_same<T, char>::value) {
750 for (const T &item : init) {
759 template<typename T>
760 static void init(T(&array)[], size_t arrayLen, const std::vector<T> &init) {
763 if (arrayLen && std::is_same<T, char>::value) {
766 for (const T &item : init) {
775 template<typename T, unsigned N>
776 static void init(T(&array)[], size_t arrayLen, const T(&str)[N]) {
778 if (arrayLen && std::is_same<T, char>::value) {
782 memcpy(array, str, std::min(arrayLen, (size_t)N) * sizeof(T));
795 template<typename T>
796 struct C2SimpleValueStruct<T[]> {
797 static_assert(std::is_same<T, char>::value || std::is_same<T, uint8_t>::value,
799 T value[];
806 inline C2SimpleValueStruct(size_t flexCount, const C2MemoryBlock<T> &block) {
810 inline C2SimpleValueStruct(size_t flexCount, const std::initializer_list<T> &init) {
814 inline C2SimpleValueStruct(size_t flexCount, const std::vector<T> &init) {
819 inline C2SimpleValueStruct(size_t flexCount, const T(&init)[N]) {
834 template<typename T>
836 static_assert(!std::is_same<T, char>::value && !std::is_same<T, uint8_t>::value,
839 T values[]; ///< array member
848 inline C2SimpleArrayStruct(size_t flexCount, const C2MemoryBlock<T> &block) {
854 inline C2SimpleArrayStruct(size_t flexCount, const std::initializer_list<T> &init) {
860 inline C2SimpleArrayStruct(size_t flexCount, const std::vector<T> &init) {
867 inline C2SimpleArrayStruct(size_t flexCount, const T(&init)[N]) {
914 template<typename T>
915 const std::vector<C2FieldDescriptor> C2SimpleValueStruct<T>::FieldList() {
918 template<typename T>
919 const std::vector<C2FieldDescriptor> C2SimpleValueStruct<T[]>::FieldList() {
922 template<typename T>
923 const std::vector<C2FieldDescriptor> C2SimpleArrayStruct<T>::FieldList() {