This is Unofficial EPICS BASE Doxygen Site
pvType.h
Go to the documentation of this file.
1 /* pvType.h */
2 /*
3  * Copyright information and license terms for this software can be
4  * found in the file LICENSE that is included with the distribution
5  */
10 /* Definitions for the primitive types for pvData.
11  * It also defines the arrays of the primitive types
12  */
13 
14 #ifndef PVTYPE_H
15 #define PVTYPE_H
16 
17 #if defined(_WIN32) && !defined(_MINGW)
18 #pragma warning( push )
19 #pragma warning(disable: 4251)
20 #endif
21 
22 #include <string>
23 #include <vector>
24 
25 #if defined(vxWorks) && \
26  (_WRS_VXWORKS_MAJOR+0 <= 6) && (_WRS_VXWORKS_MINOR+0 < 9)
27 typedef int intptr_t;
28 typedef unsigned int uintptr_t;
29 #ifndef INT64_MAX
30 #define INT64_MAX (0x7fffffffffffffffLL)
31 #define UINT64_MAX (0xffffffffffffffffULL)
32 #endif
33 #elif _MSC_VER==1500
34 #include <epicsTypes.h>
35 typedef epicsUInt8 uint8_t;
36 typedef epicsInt8 int8_t;
37 typedef epicsUInt16 uint16_t;
38 typedef epicsInt16 int16_t;
39 typedef epicsUInt32 uint32_t;
40 typedef epicsInt32 int32_t;
41 typedef epicsUInt64 uint64_t;
42 typedef epicsInt64 int64_t;
43 #else
44 #include <stdint.h>
45 #endif
46 
47 #include <pv/sharedPtr.h>
48 
50 namespace epics {
52 namespace pvData {
53 
54 namespace detail {
55  // Pick either type If or type Else to not be Cond
56  template<typename Cond, typename If, typename Else>
57  struct pick_type { typedef If type; };
58  template<typename Cond, typename Else>
59  struct pick_type<Cond,Cond,Else> { typedef Else type; };
60 }
61 
69 typedef detail::pick_type<int8_t, signed char,
75 typedef int8_t int8;
79 typedef int16_t int16;
83 typedef int32_t int32;
87 typedef int64_t int64;
91 typedef uint8_t uint8;
95 typedef uint16_t uint16;
99 typedef uint32_t uint32;
103 typedef uint64_t uint64;
104 
105 // float and double are types
106 
110 typedef std::vector<std::string> StringArray;
111 typedef std::tr1::shared_ptr<StringArray> StringArrayPtr;
112 inline std::string * get(StringArray &value)
113 {
114  return &value[0];
115 }
116 inline std::string const * get(StringArray const &value)
117 {
118  return static_cast<std::string const *>(&value[0]);
119 }
120 inline std::string * get(StringArrayPtr &value)
121 {
122  return get(*value.get());
123 }
124 inline std::string const * get(StringArrayPtr const &value)
125 {
126  return get(*value.get());
127 }
128 inline StringArray & getVector(StringArrayPtr &value)
129 {
130  return *value.get();
131 }
132 inline StringArray const & getVector(StringArrayPtr const &value)
133 {
134  return *value.get();
135 }
136 typedef std::vector<std::string>::iterator StringArray_iterator;
137 typedef std::vector<std::string>::const_iterator StringArray_const_iterator;
138 
139 }}
140 
141 #if defined(_WIN32) && !defined(_MINGW)
142 #pragma warning( pop )
143 #endif
144 
145 #endif /* PVTYPE_H */
int8_t int8
Definition: pvType.h:75
Definition: link.h:174
std::vector< std::string >::const_iterator StringArray_const_iterator
Definition: pvType.h:137
uint16_t uint16
Definition: pvType.h:95
unsigned short epicsUInt16
Definition: epicsTypes.h:41
StringArray & getVector(StringArrayPtr &value)
Definition: pvType.h:128
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
unsigned char epicsUInt8
Definition: epicsTypes.h:39
unsigned int epicsUInt32
Definition: epicsTypes.h:43
unsigned long long epicsUInt64
Definition: epicsTypes.h:45
uint64_t uint64
Definition: pvType.h:103
char epicsInt8
Definition: epicsTypes.h:38
int64_t int64
Definition: pvType.h:87
std::vector< std::string > StringArray
Definition: pvType.h:110
detail::pick_type< int8_t, signed char, detail::pick_type< uint8_t, char, unsigned char >::type >::type boolean
Definition: pvType.h:71
int16_t int16
Definition: pvType.h:79
short epicsInt16
Definition: epicsTypes.h:40
std::vector< std::string >::iterator StringArray_iterator
Definition: pvType.h:136
std::tr1::shared_ptr< StringArray > StringArrayPtr
Definition: pvType.h:111
int32_t int32
Definition: pvType.h:83
int epicsInt32
Definition: epicsTypes.h:42
uint8_t uint8
Definition: pvType.h:91
long long epicsInt64
Definition: epicsTypes.h:44
uint32_t uint32
Definition: pvType.h:99