11 #ifndef RTIREFLEX_ENABLE_IF_H
12 #define RTIREFLEX_ENABLE_IF_H
21 #include <type_traits>
22 #include <boost/range.hpp>
23 #include <boost/range/any_range.hpp>
25 #include <boost/fusion/sequence/intrinsic/at.hpp>
26 #include <boost/fusion/include/at.hpp>
27 #include <boost/fusion/sequence/intrinsic/size.hpp>
28 #include <boost/fusion/include/size.hpp>
29 #include <boost/optional.hpp>
35 #if ((RTI_DDS_VERSION_MAJOR==5) && (RTI_DDS_VERSION_MINOR==1))
37 #ifndef REFLEX_STATIC_STRING_BOUND
38 #define REFLEX_STATIC_STRING_BOUND 256
41 #ifndef REFLEX_STATIC_SEQUENCE_BOUND
42 #define REFLEX_STATIC_SEQUENCE_BOUND 256
45 #elif ((RTI_DDS_VERSION_MAJOR==5) && (RTI_DDS_VERSION_MINOR==2))
47 #ifndef REFLEX_STATIC_STRING_BOUND
48 #define REFLEX_STATIC_STRING_BOUND 256
51 #ifndef REFLEX_STATIC_SEQUENCE_BOUND
52 #define REFLEX_STATIC_SEQUENCE_BOUND 256
55 #endif // RTI_DDS_VERSION_MAJOR
65 template <
class TagType,
class... Cases>
77 boost::forward_traversal_tag,
84 boost::forward_traversal_tag,
85 T, std::ptrdiff_t >(std::forward<U>(u)...)
94 boost::forward_traversal_tag,
99 template <
class T,
size_t Bound>
102 template <
class... U>
104 :
Range<T>(std::forward<U>(u)...)
157 dst =
static_cast<T
>(src);
203 namespace type_traits {
235 template <>
struct is_primitive<unsigned long long> : true_type{};
238 template <
class... Args>
247 template <
class TagType,
class... Cases>
295 template <
typename... Args>
298 template <
typename... Args>
301 template <
typename T>
304 template <
typename T,
size_t N>
307 template <
typename T,
size_t N>
313 template <
class T,
class Comp,
class Alloc>
316 template <
class T,
class Comp,
class Alloc>
322 template <
class Key,
class T,
class Comp,
class Alloc>
325 template <
class Key,
class T,
class Comp,
class Alloc>
331 template <
class T,
size_t Dim>
334 template <
class T,
size_t Dim>
355 template <
class T,
class Alloc>
358 template <
class T,
class Alloc>
361 template <
class T,
class Alloc>
364 template <
class T,
class Alloc>
367 template <
class Key,
class Comp,
class Alloc>
370 template <
class Key,
class Comp,
class Alloc>
373 template <
class Key,
class T,
class Comp,
class Alloc>
376 template <
class Key,
class T,
class Comp,
class Alloc>
382 template <
class TagType,
class... Args>
385 template <
class TagType,
class... Args>
391 template <
class... Args>
394 template <
class... Args>
406 template <
class T,
size_t N>
409 template <
class T,
size_t N>
416 template <
class... T>
423 template <
class C,
bool>
472 template <
class T,
class Parent = void,
int Index = -1>
478 template <
class T,
class Parent = void,
int Index = -1>
481 static const unsigned int value = REFLEX_STATIC_SEQUENCE_BOUND;
492 template <
bool,
class T =
void>
501 template <
bool,
class T =
void>
509 template <
bool,
class T =
void>
517 template <
size_t... Dims>
519 enum {
size =
sizeof...(Dims) };
522 template <
size_t Arg,
class DimList>
525 template <
size_t Head,
size_t... Args>
530 template <
size_t Head>
555 template <
class T,
size_t Dim>
562 template <
class T,
size_t Dim>
599 template<
class T,
size_t N>
604 template <
class T,
size_t N>
609 template <
class T,
class... U>
619 template <
size_t Head,
size_t... Tail>
621 static const size_t value =
627 static const uint64_t value = N;
633 template <
size_t... Dims>
635 static const uint64_t value =
multiply<Dims...>::value;
638 template <
class FusionSeq,
size_t I>
642 boost::fusion::result_of::at_c<FusionSeq, I>::type
type;
645 template <
class... Args,
size_t I>
646 struct at<std::tuple<Args...>, I>
648 typedef typename std::tuple_element<I, std::tuple<Args...>>
::type type;
651 template <
class... Args,
size_t I>
652 struct at<const std::tuple<Args...>, I>
664 template <
class First,
class Second,
size_t I>
665 struct at<std::pair<First, Second>, I>
671 template <
class First,
class Second,
size_t I>
672 struct at<const std::pair<First, Second>, I>
675 std::tuple_element<I, std::pair<First, Second>>
::type const type;
678 template <
class FusionSeq>
683 boost::fusion::result_of::size<FusionSeq>::type::value
687 template <
class First,
class Second>
688 struct size<std::pair<First, Second>>
693 template <
class First,
class Second>
694 struct size<const std::pair<First, Second>>
699 template <
class... Args>
700 struct size<std::tuple<Args...>>
702 enum { value = std::tuple_size<std::tuple<Args...>>::value };
705 template <
class... Args>
706 struct size<const std::tuple<Args...>>
708 enum { value = std::tuple_size<
const std::tuple<Args...>>::value };
711 template <
size_t I,
class FusionSeq>
716 return boost::fusion::at_c<I>(seq);
719 template <
size_t I,
class FusionSeq>
720 typename disable_if_lazy <reflex::type_traits::is_tuple<FusionSeq>::value,
721 at<const FusionSeq, I >> ::type
722 get(
const FusionSeq & seq)
724 return boost::fusion::at_c<I>(seq);
727 template <
size_t I,
class... Args>
729 typename at<std::tuple<Args...>, I>::type &
730 get(std::tuple<Args...> & tuple)
732 return std::get<I>(tuple);
735 template <
size_t I,
class... Args>
737 typename at<
const std::tuple<Args...>, I>::type &
738 get(
const std::tuple<Args...> & tuple)
740 return std::get<I>(tuple);
743 template <
size_t I,
class First,
class Second>
745 typename at<std::pair<First, Second>, I>::type &
746 get(std::pair<First, Second> & pair)
748 return std::get<I>(pair);
751 template <
size_t I,
class First,
class Second>
753 typename at<const std::pair<First, Second>, I>::type &
754 get(
const std::pair<First, Second> & pair)
756 return std::get<I>(pair);
765 template <
class... Args>
768 typedef std::tuple<typename remove_reference<Args>::type...>
type;
771 template <
class... Args>
774 typedef const std::tuple<typename remove_reference<Args>::type...>
type;
782 template <
class T,
size_t I,
size_t... J>
788 typedef std::array<Nested, I>
type;
791 template <
class T,
size_t I>
801 #endif // RTIREFLEX_ENABLE_IF_H
Definition: enable_if.h:413
Definition: disc_union.h:139
std::array< Nested, I > type
Definition: enable_if.h:788
static const unsigned int value
Definition: enable_if.h:475
Definition: disc_union.h:27
C::value_type value_type
Definition: enable_if.h:429
Definition: enable_if.h:329
Definition: enable_if.h:441
boost::any_range< T, boost::forward_traversal_tag, T, std::ptrdiff_t > Range
Definition: enable_if.h:95
Definition: enable_if.h:783
Definition: enable_if.h:263
void enum_cast(T &dst, DDS_Long src)
Casts integers to user-defined enumeration types.
Definition: enable_if.h:155
#define REFLEX_STATIC_STRING_BOUND
Static bound for string types. Default 256.
Definition: adapt_macros.h:23
Definition: enable_if.h:275
void iterator
Definition: enable_if.h:437
Definition: enable_if.h:132
Definition: enable_if.h:311
Definition: enable_if.h:344
Definition: enable_if.h:389
Definition: enable_if.h:380
Definition: enable_if.h:293
MultiDimArray< T, J...>::type Nested
Definition: enable_if.h:786
BoundedRange(U &&...u)
Definition: enable_if.h:103
Definition: enable_if.h:284
void value_type
Definition: enable_if.h:436
Definition: enable_if.h:459
Definition: enable_if.h:269
static const unsigned int value
Definition: enable_if.h:481
Definition: enable_if.h:265
Definition: enable_if.h:251
Definition: enable_if.h:259
Definition: enable_if.h:215
Definition: enable_if.h:398
Definition: enable_if.h:134
Definition: enable_if.h:353
Definition: enable_if.h:209
Definition: enable_if.h:424
Definition: enable_if.h:466
Definition: enable_if.h:257
std::array< T, I > type
Definition: enable_if.h:795
Definition: enable_if.h:457
C::iterator iterator
Definition: enable_if.h:430
Definition: enable_if.h:271
unsigned char octet_t
Definition: dd_extra.h:48
container_traits_impl< C, is_container< C >::value >::iterator iterator
Definition: enable_if.h:453
reflex::meta::false_type has_base
Definition: enable_if.h:467
container_traits_impl< C, is_container< C >::value >::value_type value_type
Definition: enable_if.h:447
Definition: enable_if.h:473
Definition: enable_if.h:479
Definition: enable_if.h:253
Definition: enable_if.h:320
Definition: enable_if.h:470
Definition: enable_if.h:302