gatb.core-API-0.0.0
|
Container of IProperty instances with DP Visitor capability. More...
#include <IProperty.hpp>
Public Member Functions | |
virtual void | accept (IPropertiesVisitor *visitor)=0 |
virtual IProperty * | add (size_t depth, const std::string &aKey, const char *format=0,...)=0 |
virtual IProperty * | add (size_t depth, const std::string &aKey, const std::string &aValue)=0 |
virtual void | add (size_t depth, IProperties *prop)=0 |
virtual void | add (size_t depth, const IProperties &prop)=0 |
virtual void | merge (IProperties *prop)=0 |
virtual IProperty * | operator[] (const std::string &key)=0 |
virtual IProperty * | get (const std::string &key) const =0 |
virtual std::string | getStr (const std::string &key) const =0 |
virtual int64_t | getInt (const std::string &key) const =0 |
virtual double | getDouble (const std::string &key) const =0 |
virtual void | setStr (const std::string &key, const std::string &value)=0 |
virtual void | setInt (const std::string &key, const int64_t &value)=0 |
virtual void | setDouble (const std::string &key, const double &value)=0 |
virtual IProperties * | clone ()=0 |
virtual std::list< IProperties * > | map (const char *separator)=0 |
virtual std::set< std::string > | getKeys ()=0 |
virtual void | setToFront (const std::string &key)=0 |
virtual std::string | getXML ()=0 |
virtual void | readXML (std::istream &stream)=0 |
Public Member Functions inherited from SmartPointer | |
void | use () |
void | forget () |
Public Member Functions inherited from ISmartPointer | |
virtual | ~ISmartPointer () |
Friends | |
std::ostream & | operator<< (std::ostream &s, const IProperties &p) |
Additional Inherited Members | |
Protected Member Functions inherited from SmartPointer | |
SmartPointer () | |
virtual | ~SmartPointer () |
Container of IProperty instances with DP Visitor capability.
This interface merely defines a container of IProperty instances; it contains several 'add' methods for adding IProperty instances into the container.
It is possible to retrieve a specific IProperty instance given a key.
The main method is 'accept'; its purpose is to visit each contained IProperty instance. Note that the only way to iterate the whole IProperty set is to define its own IPropertiesVisitor class and make it accepted by the IProperties instance; the 'visitProperty' method should be then called for each IProperty instance.
It is defined as a SmartPointer for easing instance life cycle management.
|
pure virtual |
Accept a visitor (should loop over all IProperty instances).
[in] | visitor | : visitor to be accepted |
Implemented in Properties.
|
pure virtual |
Add a IProperty instance given a depth, a key and a value provided in a printf way.
[in] | depth | : depth of the property to be added |
[in] | aKey | : key of the property to be added |
[in] | format | : define the format of the value of the property, the actual value being defined by the ellipsis |
Implemented in Properties.
|
pure virtual |
Add a IProperty instance given a depth, a key and a value.
[in] | depth | : depth of the property to be added |
[in] | aKey | : key of the property to be added |
[in] | aValue | : value (as a string) of the property to be added |
Implemented in Properties.
|
pure virtual |
Add all the IProperty instances contained in the provided IProperties instance. Note that a depth is provided and is added to the depth of each added IProperty instance.
[in] | depth | : depth to be added to each depth of added instances. |
[in] | prop | : instance holding IProperty instances to be added |
Implemented in Properties.
|
pure virtual |
Add all the IProperty instances contained in the provided IProperties instance. Note that a depth is provided and is added to the depth of each added IProperty instance.
[in] | depth | : depth to be added to each depth of added instances. |
[in] | prop | : instance holding IProperty instances to be added |
Implemented in Properties.
|
pure virtual |
|
pure virtual |
Returns the IProperty instance given a key.
[in] | key | : the key |
Implemented in Properties.
|
pure virtual |
Get the value of a property given its key.
[in] | key | : the key of the property |
Implemented in Properties.
|
pure virtual |
Get the value of a property given its key.
[in] | key | : the key of the property |
Implemented in Properties.
|
pure virtual |
|
pure virtual |
Get the value of a property given its key.
[in] | key | : the key of the property |
Implemented in Properties.
|
pure virtual |
|
pure virtual |
Distribute arguments that are comma separated list.
Implemented in Properties.
|
pure virtual |
Merge the IProperty instances contained in the provided IProperties instance.
[in] | prop | : instance holding IProperty instances to be added |
Implemented in Properties.
|
pure virtual |
Returns the IProperty instance given a key.
[in] | key | : the key |
Implemented in Properties.
|
pure virtual |
Fill a Properties instance from an XML stream.
[in] | stream | the stream to be read (file, string...) |
Implemented in Properties.
|
pure virtual |
Set the value of a property given its key.
[in] | key | : the key of the property |
[in] | value | : value to be set. |
Implemented in Properties.
|
pure virtual |
Set the value of a property given its key.
[in] | key | : the key of the property |
[in] | value | : value to be set. |
Implemented in Properties.
|
pure virtual |
Set the value of a property given its key.
[in] | key | : the key of the property |
[in] | value | : value to be set. |
Implemented in Properties.
|
pure virtual |
Move the item (given its key) to the front of the container.
[in] | key | : the key of the item to be moved. |
Implemented in Properties.
|
friend |
Output the properties object through an output stream
[in] | s | : the output stream |
[in] | p | : the properties object to output |