Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
plist::DictionaryOf< PO, Alloc > Class Template Reference#include <plistCollections.h>
Inheritance diagram for plist::DictionaryOf< PO, Alloc >:
![]() Detailed Descriptiontemplate<typename PO, typename Alloc = typename PO::template conversion_policy<DictionaryBase,PO>::value_conversion>
A dictionary which requires all elements to be subtypes of the PO template argument.
|
Public Types | |
typedef DictionaryBase::storage_t | storage_t |
Public Member Functions | |
DictionaryOf () | |
DictionaryOf (bool growable) | |
constructor | |
DictionaryOf (const DictionaryOf &d) | |
copy constructor (don't assign listeners) | |
DictionaryOf & | operator= (const DictionaryOf &a) |
assignment (don't assign listeners); subclass should call fireEntriesChanged after calling this (and updating its own storage) | |
virtual void | set (const ObjectBase &ob) |
polymorphic assignment (throws std::bad_cast if the assignment is between invalid types, i.e. a primitive and a collection, or different collection types) | |
virtual void | set (const DictionaryBase &a) |
handles actual setting of one dictionary to another, similar to operator=(DictionaryOf), but allows for polymorphic conversion to the template type | |
~DictionaryOf () | |
destructor | |
virtual void | setEntry (const std::string &name, PO &val, bool warnExists=false) |
Replaces the entry with the specified key, optionally warns as it does so. If you simply want to set the *value* of the specified entry, try getEntry() and assignment... | |
virtual void | addEntry (const std::string &name, PO &val, const std::string &comment="", bool warnExists=true) |
Convenience method for adding new entries, with optional comment and warning if replacing a previous entry. | |
virtual void | setEntry (const std::string &name, PO *val, bool warnExists=false) |
Replaces the entry with the specified key, optionally warns as it does so. If you simply want to set the *value* of the specified entry, try getEntry() and assignment... | |
virtual void | addEntry (const std::string &name, PO *val, const std::string &comment="", bool warnExists=true) |
Convenience method for adding new entries, with optional comment and warning if replacing a previous entry. | |
PO & | getEntry (const std::string &name) |
returns a reference to the entry with the specified name, creating it if it doesn't exist | |
PO & | operator[] (const std::string &name) |
returns a reference to the entry with the specified name, creating it if it doesn't exist | |
const_iterator | findEntry (const std::string &name) const |
returns an iterator the <key, value> pair with the specified key (returns end() if not found) | |
const_iterator | begin () const |
return an STL const_iterator to the first entry (note implicit conversion to specialized const_iterator) | |
const_iterator | end () const |
return the one-past-end const_iterator (note implicit conversion to specialized const_iterator) | |
virtual bool | canContain (const ObjectBase &obj) |
returns true if the Collection subclass allows storage of the argument | |
virtual DictionaryOf * | clone () const __attribute__((warn_unused_result)) |
clone implementation for Dictionary | |
Protected Member Functions | |
virtual bool | loadXMLNode (const std::string &name, xmlNode *val, const std::string &comment) |
called with each node being loaded so subclass can handle appropriately | |
Static Protected Member Functions | |
static PO * | allocatePO () |
allocates a new PO instance, unless PO is an abstract type, in which case a template specialization will throw a bad_cast | |
static void | assignPO (PO &a, const PO &b) |
assigns one PO to another, unless PO is ObjectBase, in which case set() is used (via template specialization) |
typedef DictionaryBase::storage_t plist::DictionaryOf< PO, Alloc >::storage_t |
shorthand for the type of the storage
Reimplemented from plist::DictionaryBase.
Definition at line 422 of file plistCollections.h.
plist::DictionaryOf< PO, Alloc >::DictionaryOf | ( | ) | [inline] |
constructor
Definition at line 446 of file plistCollections.h.
plist::DictionaryOf< PO, Alloc >::DictionaryOf | ( | bool | growable | ) | [inline, explicit] |
plist::DictionaryOf< PO, Alloc >::DictionaryOf | ( | const DictionaryOf< PO, Alloc > & | d | ) | [inline] |
plist::DictionaryOf< PO, Alloc >::~DictionaryOf | ( | ) | [inline] |
DictionaryOf< PO, Alloc > & plist::DictionaryOf< PO, Alloc >::operator= | ( | const DictionaryOf< PO, Alloc > & | a | ) | [inline] |
assignment (don't assign listeners); subclass should call fireEntriesChanged after calling this (and updating its own storage)
Definition at line 741 of file plistCollections.h.
Referenced by plist::DictionaryOf< PO, Alloc >::set().
virtual void plist::DictionaryOf< PO, Alloc >::set | ( | const ObjectBase & | ) | [inline, virtual] |
polymorphic assignment (throws std::bad_cast if the assignment is between invalid types, i.e. a primitive and a collection, or different collection types)
Implements plist::ObjectBase.
Definition at line 454 of file plistCollections.h.
void plist::DictionaryOf< PO, Alloc >::set | ( | const DictionaryBase & | a | ) | [inline, virtual] |
handles actual setting of one dictionary to another, similar to operator=(DictionaryOf), but allows for polymorphic conversion to the template type
Definition at line 669 of file plistCollections.h.
void plist::DictionaryOf< PO, Alloc >::setEntry | ( | const std::string & | name, | |
PO & | val, | |||
bool | warnExists = false | |||
) | [inline, virtual] |
Replaces the entry with the specified key, optionally warns as it does so. If you simply want to set the *value* of the specified entry, try getEntry() and assignment...
By passing a reference to the entry, you indicate you will retain responsibility for deallocation
Definition at line 517 of file plistCollections.h.
void plist::DictionaryOf< PO, Alloc >::addEntry | ( | const std::string & | name, | |
PO & | val, | |||
const std::string & | comment = "" , |
|||
bool | warnExists = true | |||
) | [inline, virtual] |
Convenience method for adding new entries, with optional comment and warning if replacing a previous entry.
By passing a reference to the entry, you indicate you will retain responsibility for deallocation
Definition at line 538 of file plistCollections.h.
Referenced by plist::ArrayBase::WrapValueConversion< PO >::addValue(), plist::ArrayBase::ConversionTo< PO >::addValue(), ConfigurationEditor::getObjectTemplates(), plist::DictionaryOf< PO, Alloc >::loadXMLNode(), plist::DictionaryOf< PO, Alloc >::operator=(), InstanceTracker< FamilyT, ClassNameT, FactoryBaseT, FactoryT >::registerInstance(), and plist::DictionaryOf< PO, Alloc >::set().
void plist::DictionaryOf< PO, Alloc >::setEntry | ( | const std::string & | name, | |
PO * | val, | |||
bool | warnExists = false | |||
) | [inline, virtual] |
Replaces the entry with the specified key, optionally warns as it does so. If you simply want to set the *value* of the specified entry, try getEntry() and assignment...
By passing a pointer to the entry, you indicate you wish the dictionary to assume responsibility for deallocation
Definition at line 561 of file plistCollections.h.
void plist::DictionaryOf< PO, Alloc >::addEntry | ( | const std::string & | name, | |
PO * | val, | |||
const std::string & | comment = "" , |
|||
bool | warnExists = true | |||
) | [inline, virtual] |
Convenience method for adding new entries, with optional comment and warning if replacing a previous entry.
By passing a pointer to the entry, you indicate you wish the dictionary to assume responsibility for deallocation
Definition at line 583 of file plistCollections.h.
PO& plist::DictionaryOf< PO, Alloc >::getEntry | ( | const std::string & | name | ) | [inline, virtual] |
returns a reference to the entry with the specified name, creating it if it doesn't exist
Implements plist::DictionaryBase.
Reimplemented in OutputConfig< T >, and OutputConfig< plist::Primitive< float > >.
Definition at line 475 of file plistCollections.h.
Referenced by plist::DictionaryOf< ObjectBase >::operator[]().
PO& plist::DictionaryOf< PO, Alloc >::operator[] | ( | const std::string & | name | ) | [inline, virtual] |
returns a reference to the entry with the specified name, creating it if it doesn't exist
Implements plist::DictionaryBase.
Definition at line 486 of file plistCollections.h.
const_iterator plist::DictionaryOf< PO, Alloc >::findEntry | ( | const std::string & | name | ) | const [inline] |
returns an iterator the <key, value> pair with the specified key (returns end() if not found)
Reimplemented from plist::DictionaryBase.
Definition at line 488 of file plistCollections.h.
Referenced by Config::setValue().
const_iterator plist::DictionaryOf< PO, Alloc >::begin | ( | ) | const [inline] |
return an STL const_iterator to the first entry (note implicit conversion to specialized const_iterator)
Reimplemented from plist::DictionaryBase.
Definition at line 491 of file plistCollections.h.
Referenced by InstanceTracker< FamilyT, ClassNameT, FactoryBaseT, FactoryT >::loadXML(), plist::DictionaryOf< PO, Alloc >::operator=(), and plist::DictionaryOf< PO, Alloc >::set().
const_iterator plist::DictionaryOf< PO, Alloc >::end | ( | ) | const [inline] |
return the one-past-end const_iterator (note implicit conversion to specialized const_iterator)
Reimplemented from plist::DictionaryBase.
Definition at line 493 of file plistCollections.h.
Referenced by InstanceTracker< FamilyT, ClassNameT, FactoryBaseT, FactoryT >::loadXML(), plist::DictionaryOf< PO, Alloc >::operator=(), ConfigurationEditor::AddCollectionEntry::refresh(), plist::DictionaryOf< PO, Alloc >::set(), and Config::setValue().
virtual bool plist::DictionaryOf< PO, Alloc >::canContain | ( | const ObjectBase & | obj | ) | [inline, virtual] |
returns true if the Collection subclass allows storage of the argument
Implements plist::Collection.
Definition at line 495 of file plistCollections.h.
DictionaryOf< PO, Alloc > * plist::DictionaryOf< PO, Alloc >::clone | ( | ) | const [inline, virtual] |
clone implementation for Dictionary
implements the clone function for dictionary
Implements plist::ObjectBase.
Definition at line 608 of file plistCollections.h.
static PO* plist::DictionaryOf< PO, Alloc >::allocatePO | ( | ) | [inline, static, protected] |
allocates a new PO instance, unless PO is an abstract type, in which case a template specialization will throw a bad_cast
Definition at line 502 of file plistCollections.h.
Referenced by plist::DictionaryOf< ObjectBase >::getEntry(), and plist::DictionaryOf< PO, Alloc >::set().
static void plist::DictionaryOf< PO, Alloc >::assignPO | ( | PO & | a, | |
const PO & | b | |||
) | [inline, static, protected] |
assigns one PO to another, unless PO is ObjectBase, in which case set() is used (via template specialization)
Definition at line 504 of file plistCollections.h.
Referenced by plist::DictionaryOf< PO, Alloc >::operator=().
bool plist::DictionaryOf< PO, Alloc >::loadXMLNode | ( | const std::string & | name, | |
xmlNode * | val, | |||
const std::string & | comment | |||
) | [inline, protected, virtual] |
called with each node being loaded so subclass can handle appropriately
Implements plist::DictionaryBase.
Reimplemented in ConfigDictionary, OutputConfig< T >, and OutputConfig< plist::Primitive< float > >.
Definition at line 622 of file plistCollections.h.
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:55 2007 by Doxygen 1.5.4 |