libmoost
|
indexed_binder allows a variable number of configurables accessed by index. More...
#include <indexed_binder.hpp>
Public Member Functions | |
indexed_binder () | |
virtual | ~indexed_binder () |
const T & | operator[] (const size_t index) const |
T & | operator[] (const size_t index) |
size_t | size () |
void | resize (size_t size) |
void | read (std::istream &source) |
load state from source | |
void | write (std::ostream &dest, int indent=0) const |
persist state to dest | |
void | set (const std::string &key, const std::string &value) |
set one key/value pair | |
void | get (const std::string &key, std::string &value) const |
get one key/value pair | |
void | list (std::vector< std::pair< std::string, std::string > > &items) |
get all key/value pairs | |
void | set_default () |
if this object can be used without deserializing (otherwise throw) | |
Private Attributes | |
std::vector< boost::shared_ptr < configurable > > | m_pconfigurables |
indexed_binder allows a variable number of configurables accessed by index.
Note that template parameter T must be of type configurable.
Definition at line 52 of file indexed_binder.hpp.
moost::configurable::indexed_binder< T >::indexed_binder | ( | ) | [inline] |
Definition at line 60 of file indexed_binder.hpp.
virtual moost::configurable::indexed_binder< T >::~indexed_binder | ( | ) | [inline, virtual] |
Definition at line 62 of file indexed_binder.hpp.
void moost::configurable::indexed_binder< T >::get | ( | const std::string & | key, |
std::string & | value | ||
) | const [virtual] |
get one key/value pair
Implements moost::configurable::configurable.
Definition at line 217 of file indexed_binder.hpp.
void moost::configurable::indexed_binder< T >::list | ( | std::vector< std::pair< std::string, std::string > > & | items | ) | [virtual] |
get all key/value pairs
Implements moost::configurable::configurable.
Definition at line 236 of file indexed_binder.hpp.
const T& moost::configurable::indexed_binder< T >::operator[] | ( | const size_t | index | ) | const [inline] |
Definition at line 64 of file indexed_binder.hpp.
T& moost::configurable::indexed_binder< T >::operator[] | ( | const size_t | index | ) | [inline] |
Definition at line 69 of file indexed_binder.hpp.
void moost::configurable::indexed_binder< T >::read | ( | std::istream & | source | ) | [virtual] |
load state from source
Implements moost::configurable::persistable.
Definition at line 104 of file indexed_binder.hpp.
void moost::configurable::indexed_binder< T >::resize | ( | size_t | size | ) | [inline] |
Definition at line 79 of file indexed_binder.hpp.
void moost::configurable::indexed_binder< T >::set | ( | const std::string & | key, |
const std::string & | value | ||
) | [virtual] |
set one key/value pair
Implements moost::configurable::configurable.
Definition at line 197 of file indexed_binder.hpp.
void moost::configurable::indexed_binder< T >::set_default | ( | ) | [virtual] |
if this object can be used without deserializing (otherwise throw)
Implements moost::configurable::persistable.
Definition at line 250 of file indexed_binder.hpp.
size_t moost::configurable::indexed_binder< T >::size | ( | ) | [inline] |
void moost::configurable::indexed_binder< T >::write | ( | std::ostream & | dest, |
int | indent = 0 |
||
) | const [virtual] |
persist state to dest
Implements moost::configurable::persistable.
Definition at line 172 of file indexed_binder.hpp.
std::vector< boost::shared_ptr< configurable > > moost::configurable::indexed_binder< T >::m_pconfigurables [private] |
Definition at line 56 of file indexed_binder.hpp.