activemq-cpp-3.6.0
activemq::util::PrimitiveValueNode Class Reference

Class that wraps around a single value of one of the many types. More...

#include <src/main/activemq/util/PrimitiveValueNode.h>

Data Structures

union  PrimitiveValue
 Define a union type comprised of the various types. More...

Public Types

enum  PrimitiveType {
  NULL_TYPE = 0, BOOLEAN_TYPE = 1, BYTE_TYPE = 2, CHAR_TYPE = 3,
  SHORT_TYPE = 4, INTEGER_TYPE = 5, LONG_TYPE = 6, DOUBLE_TYPE = 7,
  FLOAT_TYPE = 8, STRING_TYPE = 9, BYTE_ARRAY_TYPE = 10, MAP_TYPE = 11,
  LIST_TYPE = 12, BIG_STRING_TYPE = 13
}
 Enumeration for the various primitive types. More...

Public Member Functions

 PrimitiveValueNode ()
 Default Constructor, creates a value of the NULL_TYPE.
 PrimitiveValueNode (bool value)
 Boolean Value Constructor.
 PrimitiveValueNode (unsigned char value)
 Byte Value Constructor.
 PrimitiveValueNode (char value)
 Char Value Constructor.
 PrimitiveValueNode (short value)
 Short Value Constructor.
 PrimitiveValueNode (int value)
 Int Value Constructor.
 PrimitiveValueNode (long long value)
 Long Value Constructor.
 PrimitiveValueNode (float value)
 Float Value Constructor.
 PrimitiveValueNode (double value)
 Double Value Constructor.
 PrimitiveValueNode (const char *value)
 String Value Constructor.
 PrimitiveValueNode (const std::string &value)
 String Value Constructor.
 PrimitiveValueNode (const std::vector< unsigned char > &value)
 Byte Array Value Constructor.
 PrimitiveValueNode (const decaf::util::List< PrimitiveValueNode > &value)
 Primtive List Constructor.
 PrimitiveValueNode (const decaf::util::Map< std::string, PrimitiveValueNode > &value)
 Primtive Map Value Constructor.
 PrimitiveValueNode (const PrimitiveValueNode &node)
 Copy constructor.
 ~PrimitiveValueNode ()
PrimitiveValueNodeoperator= (const PrimitiveValueNode &node)
 Assignment operator, copies the data from the other node.
bool operator== (const PrimitiveValueNode &node) const
 Comparison Operator, compares this node to the other node.
PrimitiveType getType () const
 Gets the Value Type of this type wrapper.
PrimitiveValue getValue () const
 Gets the internal Primitive Value object from this wrapper.
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 consists of.
void clear ()
 Clears the value from this wrapper converting it back to a blank NULL_TYPE value.
void setBool (bool value)
 Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.
bool getBool () const
 Gets the Boolean value of this Node.
void setByte (unsigned char value)
 Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.
unsigned char getByte () const
 Gets the Byte value of this Node.
void setChar (char value)
 Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.
char getChar () const
 Gets the Character value of this Node.
void setShort (short value)
 Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.
short getShort () const
 Gets the Short value of this Node.
void setInt (int value)
 Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.
int getInt () const
 Gets the Integer 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 was previously at the index given.
long long getLong () const
 Gets the Long value of this Node.
void setFloat (float value)
 Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.
float getFloat () const
 Gets the Float value of this Node.
void setDouble (double value)
 Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.
double getDouble () const
 Gets the Double value of this Node.
void setString (const std::string &value)
 Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.
std::string getString () const
 Gets the String 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 was previously at the index given.
std::vector< unsigned char > getByteArray () const
 Gets the Byte Array value of this Node.
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 was previously at the index given.
const decaf::util::List
< PrimitiveValueNode > & 
getList () const
 Gets the Primitive List value of this Node.
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 was previously at the index given.
const decaf::util::Map
< std::string,
PrimitiveValueNode > & 
getMap () const
 Gets the Primitive Map value of this Node.
std::string toString () const
 Creates a string representation of this value.

Detailed Description

Class that wraps around a single value of one of the many types.

Manages memory for complex types, such as strings. Note: the destructor was left non-virtual so no virtual table will be created. This probably isn't necessary, but will avoid needless memory allocation. Since we'll never extend this class, not having a virtual destructor isn't a concern.

Member Enumeration Documentation

Enumeration for the various primitive types.

Enumerator:
NULL_TYPE 
BOOLEAN_TYPE 
BYTE_TYPE 
CHAR_TYPE 
SHORT_TYPE 
INTEGER_TYPE 
LONG_TYPE 
DOUBLE_TYPE 
FLOAT_TYPE 
STRING_TYPE 
BYTE_ARRAY_TYPE 
MAP_TYPE 
LIST_TYPE 
BIG_STRING_TYPE 

Constructor & Destructor Documentation

activemq::util::PrimitiveValueNode::PrimitiveValueNode ( )

Default Constructor, creates a value of the NULL_TYPE.

activemq::util::PrimitiveValueNode::PrimitiveValueNode ( bool  value)

Boolean Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( unsigned char  value)

Byte Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( char  value)

Char Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( short  value)

Short Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( int  value)

Int Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( long long  value)

Long Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( float  value)

Float Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( double  value)

Double Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( const char *  value)

String Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( const std::string &  value)

String Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( const std::vector< unsigned char > &  value)

Byte Array Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( const decaf::util::List< PrimitiveValueNode > &  value)

Primtive List Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( const decaf::util::Map< std::string, PrimitiveValueNode > &  value)

Primtive Map Value Constructor.

Parameters
value- the new value to store.
activemq::util::PrimitiveValueNode::PrimitiveValueNode ( const PrimitiveValueNode node)

Copy constructor.

Parameters
nodeThe instance of another node to copy to this one.
activemq::util::PrimitiveValueNode::~PrimitiveValueNode ( )
inline

Member Function Documentation

void activemq::util::PrimitiveValueNode::clear ( )

Clears the value from this wrapper converting it back to a blank NULL_TYPE value.

bool activemq::util::PrimitiveValueNode::getBool ( ) const

Gets the Boolean value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
unsigned char activemq::util::PrimitiveValueNode::getByte ( ) const

Gets the Byte value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
std::vector<unsigned char> activemq::util::PrimitiveValueNode::getByteArray ( ) const

Gets the Byte Array value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
char activemq::util::PrimitiveValueNode::getChar ( ) const

Gets the Character value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
double activemq::util::PrimitiveValueNode::getDouble ( ) const

Gets the Double value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
float activemq::util::PrimitiveValueNode::getFloat ( ) const

Gets the Float value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
int activemq::util::PrimitiveValueNode::getInt ( ) const

Gets the Integer value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
const decaf::util::List<PrimitiveValueNode>& activemq::util::PrimitiveValueNode::getList ( ) const

Gets the Primitive List value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
long long activemq::util::PrimitiveValueNode::getLong ( ) const

Gets the Long value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
const decaf::util::Map<std::string, PrimitiveValueNode>& activemq::util::PrimitiveValueNode::getMap ( ) const

Gets the Primitive Map value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
short activemq::util::PrimitiveValueNode::getShort ( ) const

Gets the Short value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
std::string activemq::util::PrimitiveValueNode::getString ( ) const

Gets the String value of this Node.

Returns
value contained at the given index
Exceptions
NoSuchElementExceptionthis node cannot be returned as the requested type.
PrimitiveType activemq::util::PrimitiveValueNode::getType ( ) const
inline

Gets the Value Type of this type wrapper.

Returns
the PrimitiveType value for this wrapper.
PrimitiveValue activemq::util::PrimitiveValueNode::getValue ( ) const
inline

Gets the internal Primitive Value object from this wrapper.

Returns
a copy of the contained PrimitiveValue
PrimitiveValueNode& activemq::util::PrimitiveValueNode::operator= ( const PrimitiveValueNode node)

Assignment operator, copies the data from the other node.

Parameters
nodeThe instance of another node to copy to this one.
bool activemq::util::PrimitiveValueNode::operator== ( const PrimitiveValueNode node) const

Comparison Operator, compares this node to the other node.

Returns
true if the values are the same false otherwise.
void activemq::util::PrimitiveValueNode::setBool ( bool  value)

Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::setByte ( unsigned char  value)

Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::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 was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::setChar ( char  value)

Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::setDouble ( double  value)

Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::setFloat ( float  value)

Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::setInt ( int  value)

Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::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 was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::setLong ( long long  value)

Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::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 was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::setShort ( short  value)

Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::setString ( const std::string &  value)

Sets the value of this value node to the new value specified, this method overwrites any data that was previously at the index given.

Parameters
value- the new value to assign to the element at index
void activemq::util::PrimitiveValueNode::setValue ( const PrimitiveValue value,
PrimitiveType  valueType 
)

Sets the internal PrimitiveVale object to the new value along with the tag for the type that it consists of.

Parameters
valueThe value to set as the value contained in this Node.
valueTypeThe type of the value being set into this one.
std::string activemq::util::PrimitiveValueNode::toString ( ) const

Creates a string representation of this value.

Returns
string value of this type wrapper.

The documentation for this class was generated from the following file: