activemq-cpp-3.8.2
PrimitiveValueNode.h
Go to the documentation of this file.
1 
18 #ifndef _ACTIVEMQ_UTIL_PRIMITIVEVALUENODE_H_
19 #define _ACTIVEMQ_UTIL_PRIMITIVEVALUENODE_H_
20 
21 #include <activemq/util/Config.h>
23 #include <decaf/util/Map.h>
24 #include <decaf/util/List.h>
25 
26 namespace activemq {
27 namespace util {
28 
39  public:
40 
45  NULL_TYPE = 0,
46  BOOLEAN_TYPE = 1,
47  BYTE_TYPE = 2,
48  CHAR_TYPE = 3,
49  SHORT_TYPE = 4,
50  INTEGER_TYPE = 5,
51  LONG_TYPE = 6,
52  DOUBLE_TYPE = 7,
53  FLOAT_TYPE = 8,
54  STRING_TYPE = 9,
55  BYTE_ARRAY_TYPE = 10,
56  MAP_TYPE = 11,
57  LIST_TYPE = 12,
58  BIG_STRING_TYPE = 13
59  };
60 
65 
66  bool boolValue;
67  unsigned char byteValue;
68  char charValue;
69  short shortValue;
70  int intValue;
71  long long longValue;
72  double doubleValue;
73  float floatValue;
74  std::string* stringValue;
75  std::vector<unsigned char>* byteArrayValue;
78 
79  };
80 
81  private:
82 
83  PrimitiveType valueType;
84  PrimitiveValue value;
85 
86  public:
87 
92 
97  PrimitiveValueNode(bool value);
98 
103  PrimitiveValueNode(unsigned char value);
104 
109  PrimitiveValueNode(char value);
110 
115  PrimitiveValueNode(short value);
116 
121  PrimitiveValueNode(int value);
122 
127  PrimitiveValueNode(long long value);
128 
133  PrimitiveValueNode(float value);
134 
139  PrimitiveValueNode(double value);
140 
145  PrimitiveValueNode(const char* value);
146 
151  PrimitiveValueNode(const std::string& value);
152 
157  PrimitiveValueNode(const std::vector<unsigned char>& value);
158 
164 
170 
177 
179  clear();
180  }
181 
188  PrimitiveValueNode& operator =(const PrimitiveValueNode& node);
189 
194  bool operator==(const PrimitiveValueNode& node) const;
195 
201  return valueType;
202  }
203 
209  return this->value;
210  }
211 
221  void setValue(const PrimitiveValue& value, PrimitiveType valueType);
222 
227  void clear();
228 
235  void setBool(bool value);
236 
243  bool getBool() const;
244 
251  void setByte(unsigned char value);
252 
259  unsigned char getByte() const;
260 
267  void setChar(char value);
268 
275  char getChar() const;
276 
283  void setShort(short value);
284 
291  short getShort() const;
292 
299  void setInt(int value);
300 
307  int getInt() const;
308 
315  void setLong(long long value);
316 
323  long long getLong() const;
324 
331  void setFloat(float value);
332 
339  float getFloat() const;
340 
347  void setDouble(double value);
348 
355  double getDouble() const;
356 
363  void setString(const std::string& value);
364 
371  std::string getString() const;
372 
379  void setByteArray(const std::vector<unsigned char>& value);
380 
387  std::vector<unsigned char> getByteArray() const;
388 
395  void setList(const decaf::util::List<PrimitiveValueNode>& value);
396 
403  const decaf::util::List<PrimitiveValueNode>& getList() const;
404 
411  void setMap(const decaf::util::Map<std::string, PrimitiveValueNode>& value);
412 
420 
425  std::string toString() const;
426 
427  };
428 
429 }}
430 
431 #endif /*_ACTIVEMQ_UTIL_PRIMITIVEVALUENODE_H_*/
short shortValue
Definition: PrimitiveValueNode.h:69
Define a union type comprised of the various types.
Definition: PrimitiveValueNode.h:64
unsigned char byteValue
Definition: PrimitiveValueNode.h:67
#define AMQCPP_API
Definition: Config.h:30
float floatValue
Definition: PrimitiveValueNode.h:73
~PrimitiveValueNode()
Definition: PrimitiveValueNode.h:178
Class that wraps around a single value of one of the many types.
Definition: PrimitiveValueNode.h:38
bool boolValue
Definition: PrimitiveValueNode.h:66
decaf::util::Map< std::string, PrimitiveValueNode > * mapValue
Definition: PrimitiveValueNode.h:77
PrimitiveValue getValue() const
Gets the internal Primitive Value object from this wrapper.
Definition: PrimitiveValueNode.h:208
int intValue
Definition: PrimitiveValueNode.h:70
std::string * stringValue
Definition: PrimitiveValueNode.h:74
char charValue
Definition: PrimitiveValueNode.h:68
PrimitiveType
Enumeration for the various primitive types.
Definition: PrimitiveValueNode.h:44
decaf::util::List< PrimitiveValueNode > * listValue
Definition: PrimitiveValueNode.h:76
std::vector< unsigned char > * byteArrayValue
Definition: PrimitiveValueNode.h:75
PrimitiveType getType() const
Gets the Value Type of this type wrapper.
Definition: PrimitiveValueNode.h:200
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
double doubleValue
Definition: PrimitiveValueNode.h:72
bool operator==(const ArrayPointer< T > &left, const U *right)
Definition: ArrayPointer.h:379
long long longValue
Definition: PrimitiveValueNode.h:71