activemq-cpp-3.3.0

cms::CMSProperties Class Reference

Interface for a Java-like properties object. More...

#include <src/main/cms/CMSProperties.h>

Inheritance diagram for cms::CMSProperties:

Public Member Functions

virtual ~CMSProperties () throw ()
virtual int size () const =0
 Returns the current count of all the Properties that are currently stored in the Properties object.
virtual bool isEmpty () const =0
 Returns true if the properties object is empty.
virtual const char * getProperty (const std::string &name) const =0
 Looks up the value for the given property.
virtual std::string getProperty (const std::string &name, const std::string &defaultValue) const =0
 Looks up the value for the given property.
virtual void setProperty (const std::string &name, const std::string &value)=0
 Sets the value for a given property.
virtual bool hasProperty (const std::string &name) const =0
 Check to see if the Property exists in the set.
virtual std::string remove (const std::string &name)=0
 Removes the property with the given name.
virtual std::vector< std::string > propertyNames () const =0
 Returns a vector containing all the names of the properties currently stored in the Properties object.
virtual std::vector< std::pair
< std::string, std::string > > 
toArray () const =0
 Method that serializes the contents of the property map to an array.
virtual void copy (const CMSProperties *source)=0
 Copies the contents of the given properties object to this one.
virtual CMSPropertiesclone () const =0
 Clones this object.
virtual void clear ()=0
 Clears all properties from the map.
virtual std::string toString () const =0
 Formats the contents of the Properties Object into a string that can be logged, etc.

Detailed Description

Interface for a Java-like properties object.

This is essentially a map of key-value string pairs.

Since:
1.1

Constructor & Destructor Documentation

virtual cms::CMSProperties::~CMSProperties ( ) throw () [virtual]

Member Function Documentation

virtual void cms::CMSProperties::clear ( ) [pure virtual]

Clears all properties from the map.

Implemented in activemq::util::ActiveMQProperties.

virtual CMSProperties* cms::CMSProperties::clone ( ) const [pure virtual]

Clones this object.

Returns:
a replica of this object.

Implemented in activemq::util::ActiveMQProperties.

virtual void cms::CMSProperties::copy ( const CMSProperties source) [pure virtual]

Copies the contents of the given properties object to this one.

Parameters:
sourceThe source properties object.
virtual const char* cms::CMSProperties::getProperty ( const std::string &  name) const [pure virtual]

Looks up the value for the given property.

Parameters:
nameThe name of the property to be looked up.
Returns:
the value of the property with the given name, if it exists. If it does not exist, returns NULL.

Implemented in activemq::util::ActiveMQProperties.

virtual std::string cms::CMSProperties::getProperty ( const std::string &  name,
const std::string &  defaultValue 
) const [pure virtual]

Looks up the value for the given property.

Parameters:
namethe name of the property to be looked up.
defaultValueThe value to be returned if the given property does not exist.
Returns:
The value of the property specified by name, if it exists, otherwise the defaultValue.

Implemented in activemq::util::ActiveMQProperties.

virtual bool cms::CMSProperties::hasProperty ( const std::string &  name) const [pure virtual]

Check to see if the Property exists in the set.

Parameters:
namethe name of the property to check
Returns:
true if property exists, false otherwise.

Implemented in activemq::util::ActiveMQProperties.

virtual bool cms::CMSProperties::isEmpty ( ) const [pure virtual]

Returns true if the properties object is empty.

Returns:
true if empty

Implemented in activemq::util::ActiveMQProperties.

virtual std::vector<std::string> cms::CMSProperties::propertyNames ( ) const [pure virtual]

Returns a vector containing all the names of the properties currently stored in the Properties object.

Returns:
an STL std::vector<std::string> with all the currently stored property names.

Implemented in activemq::util::ActiveMQProperties.

virtual std::string cms::CMSProperties::remove ( const std::string &  name) [pure virtual]

Removes the property with the given name.

If the property existed in the collection then it is removed and returned, otherwise an empty string is returned.

Parameters:
namethe name of the property to be removed.
Returns:
the value that was removed from the Properties, or empty string.

Implemented in activemq::util::ActiveMQProperties.

virtual void cms::CMSProperties::setProperty ( const std::string &  name,
const std::string &  value 
) [pure virtual]

Sets the value for a given property.

If the property already exists, overwrites the value.

Parameters:
nameThe name of the value to be written.
valueThe value to be written.

Implemented in activemq::util::ActiveMQProperties.

virtual int cms::CMSProperties::size ( ) const [pure virtual]

Returns the current count of all the Properties that are currently stored in the Properties object.

Returns:
the number of properties currently stored.

Implemented in activemq::util::ActiveMQProperties.

virtual std::vector< std::pair< std::string, std::string > > cms::CMSProperties::toArray ( ) const [pure virtual]

Method that serializes the contents of the property map to an array.

Returns:
list of pairs where the first is the name and the second is the value.

Implemented in activemq::util::ActiveMQProperties.

virtual std::string cms::CMSProperties::toString ( ) const [pure virtual]

Formats the contents of the Properties Object into a string that can be logged, etc.

Returns:
string value of this object.

Implemented in activemq::util::ActiveMQProperties.


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