activemq-cpp-3.9.5
activemq::util::PrimitiveMap Class Reference

Map of named primitives. More...

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

Inheritance diagram for activemq::util::PrimitiveMap:

Public Member Functions

 PrimitiveMap ()
 Default Constructor, creates an empty map.
 
virtual ~PrimitiveMap ()
 
 PrimitiveMap (const decaf::util::Map< std::string, PrimitiveValueNode > &source)
 Copy Constructor.
 
 PrimitiveMap (const PrimitiveMap &source)
 Copy Constructor.
 
std::string toString () const
 Converts the contents into a formatted string that can be output in a Log File or other debugging tool.
 
virtual PrimitiveValueNode::PrimitiveType getValueType (const std::string &key) const
 
virtual bool getBool (const std::string &key) const
 Gets the Boolean value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setBool (const std::string &key, bool value)
 Sets the value at key to the specified type.
 
virtual unsigned char getByte (const std::string &key) const
 Gets the Byte value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setByte (const std::string &key, unsigned char value)
 Sets the value at key to the specified type.
 
virtual char getChar (const std::string &key) const
 Gets the Character value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setChar (const std::string &key, char value)
 Sets the value at key to the specified type.
 
virtual short getShort (const std::string &key) const
 Gets the Short value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setShort (const std::string &key, short value)
 Sets the value at key to the specified type.
 
virtual int getInt (const std::string &key) const
 Gets the Integer value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setInt (const std::string &key, int value)
 Sets the value at key to the specified type.
 
virtual long long getLong (const std::string &key) const
 Gets the Long value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setLong (const std::string &key, long long value)
 Sets the value at key to the specified type.
 
virtual float getFloat (const std::string &key) const
 Gets the Float value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setFloat (const std::string &key, float value)
 Sets the value at key to the specified type.
 
virtual double getDouble (const std::string &key) const
 Gets the Double value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setDouble (const std::string &key, double value)
 Sets the value at key to the specified type.
 
virtual std::string getString (const std::string &key) const
 Gets the String value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setString (const std::string &key, const std::string &value)
 Sets the value at key to the specified type.
 
virtual std::vector< unsigned char > getByteArray (const std::string &key) const
 Gets the Byte Array value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.
 
virtual void setByteArray (const std::string &key, const std::vector< unsigned char > &value)
 Sets the value at key to the specified type.
 
- Public Member Functions inherited from decaf::util::StlMap< std::string, PrimitiveValueNode >
 StlMap ()
 Default constructor - does nothing.
 
 StlMap (const StlMap &source)
 Copy constructor - copies the content of the given map into this one.
 
 StlMap (const Map< std::string, PrimitiveValueNode > &source)
 Copy constructor - copies the content of the given map into this one.
 
virtual ~StlMap ()
 
virtual bool equals (const StlMap &source) const
 
virtual bool equals (const Map< std::string, PrimitiveValueNode > &source) const
 
virtual void copy (const StlMap &source)
 
virtual void copy (const Map< std::string, PrimitiveValueNode > &source)
 
virtual void clear ()
 Removes all of the mappings from this map (optional operation).The map will be empty after this call returns.
Exceptions
UnsupportedOperationExceptionif the clear operation is not supported by this map.

 
virtual bool containsKey (const std::string &key) const
 
virtual bool containsValue (const PrimitiveValueNode &value) const
 
virtual bool isEmpty () const
 
Returns
if the Map contains any element or not, TRUE or FALSE

 
virtual int size () const
 
Returns
The number of elements (key/value pairs) in this map.

 
virtual PrimitiveValueNode & get (const std::string &key)
 
virtual const PrimitiveValueNode & get (const std::string &key) const
 
virtual bool put (const std::string &key, const PrimitiveValueNode &value)
 
virtual bool put (const std::string &key, const PrimitiveValueNode &value, PrimitiveValueNode &oldValue)
 
virtual void putAll (const StlMap< std::string, PrimitiveValueNode, decaf::util::comparators::Less< std::string > > &other)
 
virtual void putAll (const Map< std::string, PrimitiveValueNode > &other)
 
virtual PrimitiveValueNode remove (const std::string &key)
 
virtual Set< MapEntry< std::string, PrimitiveValueNode > > & entrySet ()
 Returns a Set view of the mappings contained in this map.
 
virtual const Set< MapEntry< std::string, PrimitiveValueNode > > & entrySet () const
 
virtual Set< std::string > & keySet ()
 Returns a Set view of the keys contained in this map.
 
virtual const Set< std::string > & keySet () const
 
virtual Collection< PrimitiveValueNode > & values ()
 Returns a Collection view of the values contained in this map.
 
virtual const Collection< PrimitiveValueNode > & values () const
 
virtual void lock ()
 Locks the object.
 
virtual bool tryLock ()
 Attempts to Lock the object, if the lock is already held by another thread than this method returns false.
 
virtual void unlock ()
 Unlocks the object.
 
virtual void wait ()
 Waits on a signal from this object, which is generated by a call to Notify.
 
virtual void wait (long long millisecs)
 Waits on a signal from this object, which is generated by a call to Notify.
 
virtual void wait (long long millisecs, int nanos)
 Waits on a signal from this object, which is generated by a call to Notify.
 
virtual void notify ()
 Signals a waiter on this object that it can now wake up and continue.
 
virtual void notifyAll ()
 Signals the waiters on this object that it can now wake up and continue.
 
- Public Member Functions inherited from decaf::util::Map< K, V >
 Map ()
 Default constructor - does nothing.
 
virtual ~Map ()
 
virtual bool equals (const Map &source) const =0
 Compares the specified object with this map for equality.
 
virtual void copy (const Map &source)=0
 Copies the content of the source map into this map.
 
virtual void clear ()=0
 Removes all of the mappings from this map (optional operation).
 
virtual bool containsKey (const K &key) const =0
 Returns true if this map contains a mapping for the specified key.
 
virtual bool containsValue (const V &value) const =0
 Returns true if this map maps one or more keys to the specified value.
 
virtual bool isEmpty () const =0
 
virtual int size () const =0
 
virtual V & get (const K &key)=0
 Gets the value mapped to the specified key in the Map.
 
virtual const V & get (const K &key) const =0
 Gets the value mapped to the specified key in the Map.
 
virtual bool put (const K &key, const V &value)=0
 Associates the specified value with the specified key in this map (optional operation).
 
virtual bool put (const K &key, const V &value, V &oldValue)=0
 Associates the specified value with the specified key in this map (optional operation).
 
virtual void putAll (const Map< K, V > &other)=0
 Copies all of the mappings from the specified map to this map (optional operation).
 
virtual V remove (const K &key)=0
 Removes the value (key/value pair) for the specified key from the map, returns a copy of the value that was mapped to the key.
 
virtual Set< MapEntry< K, V > > & entrySet ()=0
 Returns a Set view of the mappings contained in this map.
 
virtual const Set< MapEntry< K, V > > & entrySet () const =0
 
virtual Set< K > & keySet ()=0
 Returns a Set view of the keys contained in this map.
 
virtual const Set< K > & keySet () const =0
 
virtual Collection< V > & values ()=0
 Returns a Collection view of the values contained in this map.
 
virtual const Collection< V > & values () const =0
 
- Public Member Functions inherited from decaf::util::concurrent::Synchronizable
virtual ~Synchronizable ()
 
virtual void lock ()=0
 Locks the object.
 
virtual bool tryLock ()=0
 Attempts to Lock the object, if the lock is already held by another thread than this method returns false.
 
virtual void unlock ()=0
 Unlocks the object.
 
virtual void wait ()=0
 Waits on a signal from this object, which is generated by a call to Notify.
 
virtual void wait (long long millisecs)=0
 Waits on a signal from this object, which is generated by a call to Notify.
 
virtual void wait (long long millisecs, int nanos)=0
 Waits on a signal from this object, which is generated by a call to Notify.
 
virtual void notify ()=0
 Signals a waiter on this object that it can now wake up and continue.
 
virtual void notifyAll ()=0
 Signals the waiters on this object that it can now wake up and continue.
 

Detailed Description

Map of named primitives.

Constructor & Destructor Documentation

◆ PrimitiveMap() [1/3]

activemq::util::PrimitiveMap::PrimitiveMap ( )

Default Constructor, creates an empty map.

◆ ~PrimitiveMap()

virtual activemq::util::PrimitiveMap::~PrimitiveMap ( )
virtual

◆ PrimitiveMap() [2/3]

activemq::util::PrimitiveMap::PrimitiveMap ( const decaf::util::Map< std::string, PrimitiveValueNode > &  source)

Copy Constructor.

Parameters
sourceThe Decaf Library Map instance whose elements will be copied into this Map.

◆ PrimitiveMap() [3/3]

activemq::util::PrimitiveMap::PrimitiveMap ( const PrimitiveMap source)

Copy Constructor.

Parameters
sourceThe PrimitiveMap whose elements will be copied into this Map.

Member Function Documentation

◆ getBool()

virtual bool activemq::util::PrimitiveMap::getBool ( const std::string &  key) const
virtual

Gets the Boolean value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getByte()

virtual unsigned char activemq::util::PrimitiveMap::getByte ( const std::string &  key) const
virtual

Gets the Byte value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getByteArray()

virtual std::vector< unsigned char > activemq::util::PrimitiveMap::getByteArray ( const std::string &  key) const
virtual

Gets the Byte Array value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getChar()

virtual char activemq::util::PrimitiveMap::getChar ( const std::string &  key) const
virtual

Gets the Character value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getDouble()

virtual double activemq::util::PrimitiveMap::getDouble ( const std::string &  key) const
virtual

Gets the Double value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getFloat()

virtual float activemq::util::PrimitiveMap::getFloat ( const std::string &  key) const
virtual

Gets the Float value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getInt()

virtual int activemq::util::PrimitiveMap::getInt ( const std::string &  key) const
virtual

Gets the Integer value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getLong()

virtual long long activemq::util::PrimitiveMap::getLong ( const std::string &  key) const
virtual

Gets the Long value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getShort()

virtual short activemq::util::PrimitiveMap::getShort ( const std::string &  key) const
virtual

Gets the Short value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getString()

virtual std::string activemq::util::PrimitiveMap::getString ( const std::string &  key) const
virtual

Gets the String value at the given key, if the key is not in the map or cannot be returned as the requested value then an exception of type NoSuchElementException is thrown.

Parameters
key- the location to return the value from.
Returns
the value at key in the type requested.
Exceptions
NoSuchElementExceptionif key is not in the map.
UnSupportedOperationExceptionif the value cannot be converted to the type this method returns

◆ getValueType()

virtual PrimitiveValueNode::PrimitiveType activemq::util::PrimitiveMap::getValueType ( const std::string &  key) const
virtual
Returns
the numeric type value for the given key if it exists.
Exceptions
NoSuchElementExceptionif the key is not present in the map.

◆ setBool()

virtual void activemq::util::PrimitiveMap::setBool ( const std::string &  key,
bool  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ setByte()

virtual void activemq::util::PrimitiveMap::setByte ( const std::string &  key,
unsigned char  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ setByteArray()

virtual void activemq::util::PrimitiveMap::setByteArray ( const std::string &  key,
const std::vector< unsigned char > &  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ setChar()

virtual void activemq::util::PrimitiveMap::setChar ( const std::string &  key,
char  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ setDouble()

virtual void activemq::util::PrimitiveMap::setDouble ( const std::string &  key,
double  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ setFloat()

virtual void activemq::util::PrimitiveMap::setFloat ( const std::string &  key,
float  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ setInt()

virtual void activemq::util::PrimitiveMap::setInt ( const std::string &  key,
int  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ setLong()

virtual void activemq::util::PrimitiveMap::setLong ( const std::string &  key,
long long  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ setShort()

virtual void activemq::util::PrimitiveMap::setShort ( const std::string &  key,
short  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ setString()

virtual void activemq::util::PrimitiveMap::setString ( const std::string &  key,
const std::string &  value 
)
virtual

Sets the value at key to the specified type.

Overwrites any data that was previously at this key or inserts a new element at key.

Parameters
key- the map key to set or insert.
value- the new value to set at the key location.

◆ toString()

std::string activemq::util::PrimitiveMap::toString ( ) const

Converts the contents into a formatted string that can be output in a Log File or other debugging tool.

Returns
formatted String of all elements in the map.

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