|
Public Types |
|
typedef std::vector< ObjectBase * > | storage_t |
| | shorthand for the type of the storage
|
|
typedef storage_t::iterator | iterator |
| | shorthand for iterators to be returned
|
|
typedef storage_t::const_iterator | const_iterator |
| | shorthand for iterators to be returned
|
typedef AllValueConversions<
PrimitiveBase > | FlatConversion |
typedef AllValueConversions<
ObjectBase > | AnyConversion |
Public Member Functions |
|
virtual void | removeEntry (size_t index) |
| | remove the entry at position index, which must exist (no range checking)
|
|
ObjectBase & | getEntry (size_t index) const |
| | return the value at position index, which must exist (no range checking)
|
|
ObjectBase & | operator[] (size_t index) const |
| | return the value at position index, which must exist (no range checking, equivalent to getEntry(index))
|
|
virtual ObjectBase * | resolveEntry (const std::string &path) const |
| | recursively resolves path interpreted as a series of collection entry names separated by '.', returns NULL if it doesn't exist
|
|
virtual void | clear () |
| | remove all entries in one fell swoop
|
|
const_iterator | begin () const |
| | return an STL const_iterator to the first entry
|
|
const_iterator | end () const |
| | return the one-past-end const_iterator
|
|
virtual size_t | size () const |
| | return the size of the array
|
|
virtual void | setComment (size_t index, const std::string &comment) |
| | replaces previous comment for name, or adds it if it doesn't already exist (can preceed actual entry!)
|
|
virtual const std::string & | getComment (size_t index) const |
| | returns comment retrieved from loaded file, or any subsequent call to setComment
|
| virtual void | loadXML (xmlNode *node) |
| | From the name of node, will instantiate a new ObjectBase subclass to load it.
|
|
virtual void | saveXML (xmlNode *node) const |
| | subclasses are expected to provide a working implementation
|
|
virtual std::string | toString () const |
| | return current value as a string
|
|
virtual unsigned int | getLongestKeyLen () const |
| | return the length of the longest key for formatting purposes
|
Protected Types |
typedef std::map< size_t,
std::string > | comments_t |
| | shorthand for the type of comments
|
Protected Member Functions |
|
| ArrayBase (bool growable) |
| | constructor
|
|
| ArrayBase (const ArrayBase &d) |
| | copy constructor
|
|
ArrayBase & | operator= (const ArrayBase &d) |
| | assignment; subclass should call fireEntriesChanged after calling this (and updating its own storage)
|
|
| ~ArrayBase () |
| | destructor
|
|
virtual void | takeObject (size_t index, ObjectBase *obj) |
| | indicates that the storage implementation should mark this as an externally supplied heap reference, which needs to be deleted on removal/destruction
|
|
virtual void | fireEntryRemoved (ObjectBase &val) |
| | run through collectionListeners, calling CollectionListener::plistCollectionEntryRemoved(*this,val)
|
| iterator | getSubEntry (const std::string &name, std::string::size_type &seppos) |
| | returns an entry matching just the prefix
|
| const_iterator | getSubEntry (const std::string &name, std::string::size_type &seppos) const |
| | returns an entry matching just the prefix
|
|
virtual void | cloneMyRef () |
| | called after an assignment or copy to clone the objects in myRef to perform a deep copy
|
|
virtual bool | loadXMLNode (size_t index, xmlNode *val, const std::string &comment)=0 |
Protected Attributes |
|
storage_t | arr |
| | storage of entries
|
|
std::set< ObjectBase * > | myRef |
| | objects which have been handed over to the collection for eventual de-allocation
|
| comments_t | comments |
| | storage of entry comments -- mapping from keys to help text comments for manual editing or user feedback
|
Friends |
|
std::ostream & | operator<< (std::ostream &os, const ArrayBase &d) |
| | provides textual output
|
Classes |
| class | AllValueConversions |
| class | EntryConstraint |
| struct | NoValueConversions |
| class | StringConversion |
| class | StringConversionTo |