RCFProto
 All Classes Functions Typedefs
TypeTraits.hpp
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2013, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 2.0
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18 
19 #ifndef INCLUDE_RCF_TYPETRAITS_HPP
20 #define INCLUDE_RCF_TYPETRAITS_HPP
21 
22 #include <boost/type_traits.hpp>
23 #include <boost/version.hpp>
24 
25 #if BOOST_VERSION < 106000
26 
27 #include <boost/mpl/bool_fwd.hpp>
28 namespace RCF {
29  typedef boost::mpl::true_ TrueType;
30  typedef boost::mpl::false_ FalseType;
31 }
32 
33 #else
34 
35 namespace RCF{
36  typedef boost::true_type TrueType;
37  typedef boost::false_type FalseType;
38 }
39 
40 #endif
41 
42 
43 namespace RCF {
44 
45 
46 
47  template<typename T>
48  struct IsFundamental : public boost::is_fundamental<T>
49  {};
50 
51  template<typename T>
52  struct IsConst : public boost::is_const<T>
53  {};
54 
55  template<typename T>
56  struct IsPointer : public boost::is_pointer<T>
57  {};
58 
59  template<typename T>
60  struct IsReference : public boost::is_reference<T>
61  {};
62 
63  template<typename T>
64  struct RemovePointer : public boost::remove_pointer<T>
65  {};
66 
67  template<typename T>
68  struct RemoveReference : public boost::remove_reference<T>
69  {};
70 
71  template<typename T>
72  struct RemoveCv : public boost::remove_cv<T>
73  {};
74 
75  template<typename T>
76  struct Out
77  {
78  };
79 
80  template<typename T>
81  struct RemoveOut
82  {
83  typedef T type;
84  };
85 
86  template<typename T>
87  struct IsOut : public RCF::FalseType
88  {
89  };
90 
91  template<typename T>
92  struct RemoveOut< Out<T> >
93  {
94  typedef T type;
95  };
96 
97  template<typename T>
98  struct IsOut< Out<T> >
99  {
100  typedef boost::mpl::true_ type;
101  enum { value = type::value };
102  };
103 
104 } // namespace RCF
105 
106 namespace SF {
107 
108  template<typename T> struct GetIndirection;
109 
110 } // namespace SF
111 
112 #endif // ! INCLUDE_RCF_TYPETRAITS_HPP