activemq-cpp-3.9.5
PrimitiveValueNode.h
Go to the documentation of this file.
1
18#ifndef _ACTIVEMQ_UTIL_PRIMITIVEVALUENODE_H_
19#define _ACTIVEMQ_UTIL_PRIMITIVEVALUENODE_H_
20
23#include <decaf/util/Map.h>
24#include <decaf/util/List.h>
25
26namespace activemq {
27namespace 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
67 unsigned char byteValue;
71 long long longValue;
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
110
115 PrimitiveValueNode(short value);
116
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
396
404
412
420
425 std::string toString() const;
426
427 };
428
429}}
430
431#endif /*_ACTIVEMQ_UTIL_PRIMITIVEVALUENODE_H_*/
#define AMQCPP_API
Definition: Config.h:30
Class that wraps around a single value of one of the many types.
Definition: PrimitiveValueNode.h:38
bool getBool() const
Gets the Boolean value of this Node.
void setLong(long long value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
PrimitiveValueNode(unsigned char value)
Byte Value Constructor.
void setInt(int value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
PrimitiveValueNode(const decaf::util::Map< std::string, PrimitiveValueNode > &value)
Primtive Map Value Constructor.
PrimitiveValueNode(float value)
Float Value Constructor.
std::string getString() const
Gets the String value of this Node.
bool operator==(const PrimitiveValueNode &node) const
Comparison Operator, compares this node to the other node.
void setValue(const PrimitiveValue &value, PrimitiveType valueType)
Sets the internal PrimitiveVale object to the new value along with the tag for the type that it consi...
void setMap(const decaf::util::Map< std::string, PrimitiveValueNode > &value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
~PrimitiveValueNode()
Definition: PrimitiveValueNode.h:178
void setShort(short value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
std::vector< unsigned char > getByteArray() const
Gets the Byte Array value of this Node.
short getShort() const
Gets the Short value of this Node.
float getFloat() const
Gets the Float value of this Node.
void setByteArray(const std::vector< unsigned char > &value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
void clear()
Clears the value from this wrapper converting it back to a blank NULL_TYPE value.
PrimitiveValueNode(int value)
Int Value Constructor.
PrimitiveValueNode(const PrimitiveValueNode &node)
Copy constructor.
PrimitiveValueNode(const std::string &value)
String Value Constructor.
unsigned char getByte() const
Gets the Byte value of this Node.
PrimitiveValueNode()
Default Constructor, creates a value of the NULL_TYPE.
PrimitiveValueNode(char value)
Char Value Constructor.
PrimitiveValueNode(const decaf::util::List< PrimitiveValueNode > &value)
Primtive List Constructor.
PrimitiveValueNode(const std::vector< unsigned char > &value)
Byte Array Value Constructor.
void setBool(bool value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
void setFloat(float value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
int getInt() const
Gets the Integer value of this Node.
std::string toString() const
Creates a string representation of this value.
void setList(const decaf::util::List< PrimitiveValueNode > &value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
PrimitiveValueNode(bool value)
Boolean Value Constructor.
void setString(const std::string &value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
void setByte(unsigned char value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
PrimitiveValueNode(short value)
Short Value Constructor.
PrimitiveValueNode(const char *value)
String Value Constructor.
void setChar(char value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
PrimitiveValueNode(long long value)
Long Value Constructor.
long long getLong() const
Gets the Long value of this Node.
PrimitiveValueNode(double value)
Double Value Constructor.
void setDouble(double value)
Sets the value of this value node to the new value specified, this method overwrites any data that wa...
PrimitiveType getType() const
Gets the Value Type of this type wrapper.
Definition: PrimitiveValueNode.h:200
PrimitiveType
Enumeration for the various primitive types.
Definition: PrimitiveValueNode.h:44
const decaf::util::Map< std::string, PrimitiveValueNode > & getMap() const
Gets the Primitive Map value of this Node.
PrimitiveValue getValue() const
Gets the internal Primitive Value object from this wrapper.
Definition: PrimitiveValueNode.h:208
const decaf::util::List< PrimitiveValueNode > & getList() const
Gets the Primitive List value of this Node.
double getDouble() const
Gets the Double value of this Node.
char getChar() const
Gets the Character value of this Node.
An ordered collection (also known as a sequence).
Definition: List.h:47
An object that maps keys to values.
Definition: Map.h:88
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition: CachedConsumer.h:24
Define a union type comprised of the various types.
Definition: PrimitiveValueNode.h:64
char charValue
Definition: PrimitiveValueNode.h:68
double doubleValue
Definition: PrimitiveValueNode.h:72
std::string * stringValue
Definition: PrimitiveValueNode.h:74
decaf::util::List< PrimitiveValueNode > * listValue
Definition: PrimitiveValueNode.h:76
long long longValue
Definition: PrimitiveValueNode.h:71
int intValue
Definition: PrimitiveValueNode.h:70
bool boolValue
Definition: PrimitiveValueNode.h:66
std::vector< unsigned char > * byteArrayValue
Definition: PrimitiveValueNode.h:75
unsigned char byteValue
Definition: PrimitiveValueNode.h:67
short shortValue
Definition: PrimitiveValueNode.h:69
float floatValue
Definition: PrimitiveValueNode.h:73
decaf::util::Map< std::string, PrimitiveValueNode > * mapValue
Definition: PrimitiveValueNode.h:77