Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
plist::Collection Class Reference
Inheritance diagram for plist::Collection:
Detailed DescriptionProvides a common base class for the collection-oriented primitives, Dictionary and Array When a collection, you can call addEntry() or setEntry() you can either:
This class supports callbacks upon modification through the use of the CollectionListener interface. Note that we only store a pointer to the listener list, which is typically unallocated when no listeners are active. This should ensure minimal memory usage per object, as well as support safe storage of plist objects in inter-process shared memory regions. If you are using these in a shared memory region, just be sure that only the process with listeners does any and all modifications, and that it unsubscribes before detaching from the region (or else destroys the region itself) There isn't a callback if entries themselves are modified, only when new entries are added, or old ones removed. If you want to know any time any aspect of any entry is modified, listen for the add and remove callbacks, and then add yourself as a listener to each entry individually. Definition at line 69 of file plistCollections.h.
Member Enumeration Documentationused to define values for LoadSavePolicy values so we can test a bit out of the policy value
Definition at line 75 of file plistCollections.h. Arguments for setLoadPolicy() and setSavePolicy(), specifies how to handle orphaned entries when loading or saving.
Commonly, you'll want to use SYNC (the default) to support dynamically-resized storage, and FIXED load/SYNC save for configuration settings (or perhaps FIXED load and UNION save to keep 'extra' values in the file...)
Definition at line 95 of file plistCollections.h. Constructor & Destructor Documentation
destructor Definition at line 54 of file plistCollections.cc.
constructor Definition at line 158 of file plistCollections.h.
constructor Definition at line 160 of file plistCollections.h.
copy constructor (don't assign listeners) Definition at line 162 of file plistCollections.h. Member Function Documentation
get notified of changes; be sure to call removeCollectionListener() before destructing l! Definition at line 153 of file plistCollections.cc. Referenced by plist::AutoCollectionListener::activate(), and KinematicJoint::ComponentsListener::ComponentsListener().
returns true if the Collection subclass allows storage of the argument Implemented in plist::DictionaryOf< PO, Alloc >, plist::ArrayOf< PO, Alloc >, plist::RGBColor< T >, plist::DictionaryOf< SinusoidalParameters >, plist::DictionaryOf< plist::Primitive< float > >, plist::DictionaryOf< plist::Primitive< T > >, plist::DictionaryOf< plist::Point >, plist::ArrayOf< ContactPoint >, plist::ArrayOf< plist::ArrayOf< plist::Primitive< float > > >, plist::ArrayOf< LinkComponent >, plist::ArrayOf< SensorInfo >, plist::ArrayOf< plist::Primitive< std::string > >, plist::ArrayOf< KinematicJoint >, plist::ArrayOf< plist::Primitive< float > >, plist::ArrayOf< plist::Primitive< T > >, plist::ArrayOf< plist::Angle >, plist::ArrayOf< LegParameters >, and plist::ArrayOf< plist::Primitive< PLISTREAL > >. Referenced by ConfigurationEditor::AddCollectionEntry::refresh().
remove all entries in one fell swoop Implemented in ConvexPolyObstacle, HierarchicalObstacle, plist::DictionaryBase, plist::ArrayBase, and plist::RGBColor< T >.
when an empty string is needed for not found items (defined as a function instead of just a constant member so there's no issues with initialization order) Definition at line 181 of file plistCollections.h. Referenced by plist::ArrayBase::getComment(), and plist::DictionaryBase::getComment().
run through collectionListeners, calling CollectionListener::plistCollectionEntriesChanged(*this) Definition at line 210 of file plistCollections.cc. Referenced by plist::ArrayBase::clear(), plist::DictionaryBase::clear(), plist::DictionaryBase::renameEntry(), plist::ArrayOf< PO, Alloc >::setEntry(), and plist::DictionaryBase::swapEntry().
run through collectionListeners, calling CollectionListener::plistCollectionEntryAdded(*this,val) Definition at line 186 of file plistCollections.cc. Referenced by plist::ArrayOf< PO, Alloc >::addEntry(), plist::ArrayOf< plist::Primitive< PLISTREAL > >::addEntry(), plist::DictionaryOf< PO, Alloc >::addEntry(), plist::DictionaryOf< plist::Point >::getEntry(), plist::ArrayOf< PO, Alloc >::setEntry(), and plist::DictionaryOf< PO, Alloc >::setEntry().
run through collectionListeners, calling CollectionListener::plistCollectionEntryRemoved(*this,val) Reimplemented in plist::DictionaryBase, plist::ArrayBase, and plist::RGBColor< T >. Definition at line 198 of file plistCollections.cc.
returns a prefix for items within the collection Definition at line 222 of file plistCollections.cc. Referenced by plist::ArrayBase::saveXML(), plist::DictionaryBase::saveXML(), KinematicJoint::saveXML(), KinematicJointSaver::saveXML(), OutputConfig< T >::saveXML(), and Config::saveXML().
returns index corresponding to name, which should encode an integer value less than or equal to the current size Definition at line 235 of file plistCollections.cc. Referenced by plist::ArrayBase::getSubEntry(), and plist::ArrayBase::resolveEntry().
returns loadPolicy Definition at line 134 of file plistCollections.h. Referenced by plist::ArrayBase::ArrayBase(), and plist::DictionaryBase::DictionaryBase().
returns longest key length which matches the regular expression Implemented in plist::DictionaryBase, plist::ArrayBase, and plist::RGBColor< T >.
returns saveCondensed Definition at line 129 of file plistCollections.h.
returns savePolicy Definition at line 135 of file plistCollections.h. Referenced by plist::ArrayBase::ArrayBase(), and plist::DictionaryBase::DictionaryBase().
returns warnUnused Definition at line 132 of file plistCollections.h.
test if l is currently registered as a listener Definition at line 174 of file plistCollections.cc.
assignment (don't assign listeners); subclass should call fireEntriesChanged after calling this (and updating its own storage) Definition at line 103 of file plistCollections.h.
how much to indent each sub-collection (defined as a function instead of just a constant member so there's no issues with initialization order) Definition at line 187 of file plistCollections.h. Referenced by getIndentationPrefix(), plist::ArrayBase::saveXML(), plist::DictionaryBase::saveXML(), KinematicJoint::saveXML(), and OutputConfig< T >::saveXML().
no longer take notification of changes to this object's value Definition at line 161 of file plistCollections.cc. Referenced by plist::AutoCollectionListener::deactivate(), and KinematicJoint::ComponentsListener::~ComponentsListener().
Processes a command of the form 'collection.key = value' or 'collection.array += entry'. Returns whether the assignment was successful, and if an error occurrs, places the error message in errstream Definition at line 64 of file plistCollections.cc.
Processes a command of the form 'collection.key = value' or 'collection.array += entry'. Returns whether the assignment was successful, but does not provide error message (see other version if you want a string to give user) Definition at line 59 of file plistCollections.cc.
recursively resolves path interpreted as a series of collection entry names separated by '.', returns NULL if it doesn't exist Implemented in plist::DictionaryBase, plist::ArrayBase, and plist::RGBColor< T >. Referenced by ConfigurationEditor::refresh(), resolveAssignment(), plist::ArrayBase::resolveEntry(), plist::DictionaryBase::resolveEntry(), and Config::setValue().
assigns loadPolicy Definition at line 136 of file plistCollections.h. Referenced by plist::DictionaryBase::loadXML(), and setLoadSavePolicy().
assigns loadPolicy and savePolicy respectively Definition at line 138 of file plistCollections.h. Referenced by plist::ArrayBase::ArrayBase(), plist::DictionaryBase::DictionaryBase(), DriverMessaging::FixedPoints::FixedPoints(), XWalkParameters::init(), OdometrySensor::init(), GPSSensor::init(), SensorFeedback::init(), SensorContact::init(), SensorRangeFinder::init(), SensorInfo::init(), plist::RGBColor< T >::init(), plist::Point::init(), PlannerObstacle< N >::init(), LinkComponent::init(), DynamicRobotState::init(), DriverMessaging::ContactPoint::init(), KinematicJoint::initEntries(), InstanceTypeLoader::InstanceTypeLoader(), XWalkParameters::LegParameters::LegParameters(), DriverMessaging::LoadPrediction::LoadPrediction(), PhysicsWorld::PhysicsWorld(), PIDMotorController::PIDMotorController(), DriverMessaging::SensorPriority::SensorPriority(), XWalkParameters::SinusoidalParameters::SinusoidalParameters(), and WheeledWalkMC::WheeledWalkMC().
set saveCondensed (not automatically recursive) Definition at line 128 of file plistCollections.h.
assigns savePolicy Definition at line 137 of file plistCollections.h. Referenced by setLoadSavePolicy().
set warnUnused Definition at line 131 of file plistCollections.h. Referenced by Config::behaviors_config::behaviors_config(), InstanceTypeLoader::InstanceTypeLoader(), and plist::loadXML().
return the size of the collection Implemented in plist::DictionaryBase, plist::ArrayBase, and plist::RGBColor< T >. Referenced by ConfigurationEditor::refresh().
defines separator between sub-collections (defined as a function instead of just a constant member so there's no issues with initialization order) Definition at line 142 of file plistCollections.h. Referenced by plist::ArrayBase::getLongestKeyLen(), plist::DictionaryBase::getLongestKeyLen(), plist::ArrayBase::getSubEntry(), plist::DictionaryBase::getSubEntry(), and ConfigurationEditor::refresh().
return current value as a double (throws std::runtime_error exception if incompatable, e.g. dictionary or array to value type) Implements plist::ObjectBase. Definition at line 184 of file plistCollections.cc.
return current value as an (long) integer (throws std::runtime_error exception if incompatable, e.g. dictionary or array to value type) Implements plist::ObjectBase. Definition at line 183 of file plistCollections.cc. Member Data Documentation
stores a list of the current listeners Definition at line 171 of file plistCollections.h. Referenced by addCollectionListener(), fireEntriesChanged(), fireEntryAdded(), fireEntryRemoved(), isCollectionListener(), removeCollectionListener(), and ~Collection().
when saving comments to file, the key name will automatically be prepended to the comment, unless the key is found within this many characters from the beginning of the comment Definition at line 192 of file plistCollections.h. Referenced by plist::DictionaryBase::saveOverXMLNode(), and plist::DictionaryBase::saveXMLNode().
specifies how to handle "orphaned" entries while loading Definition at line 199 of file plistCollections.h. Referenced by getLoadPolicy(), plist::ArrayBase::loadXML(), plist::DictionaryBase::loadXML(), plist::ArrayOf< PO, Alloc >::loadXMLNode(), plist::DictionaryOf< PO, Alloc >::loadXMLNode(), plist::ArrayOf< PO, Alloc >::operator=(), plist::DictionaryOf< PO, Alloc >::operator=(), plist::ArrayOf< PO, Alloc >::set(), plist::DictionaryOf< PO, Alloc >::set(), and setLoadPolicy().
if true, will skip putting "headline" comments before sub-collections Definition at line 195 of file plistCollections.h. Referenced by getSaveCondensed(), plist::DictionaryBase::saveOverXMLNode(), plist::DictionaryBase::saveXMLNode(), and setSaveCondensed().
specifies how to handle "orphaned" entries while saving Definition at line 201 of file plistCollections.h. Referenced by getSavePolicy(), plist::ArrayOf< PO, Alloc >::loadXMLNode(), plist::ArrayOf< PO, Alloc >::operator=(), plist::ArrayBase::saveXML(), plist::DictionaryBase::saveXML(), plist::ArrayOf< PO, Alloc >::set(), and setSavePolicy().
if true (the default) loadXML will give warnings using FIXED policy and there are ignored entries in the source while loading or ignored entries in the destination while saving Definition at line 197 of file plistCollections.h. Referenced by getUnusedWarning(), plist::ArrayOf< PO, Alloc >::loadXMLNode(), plist::DictionaryOf< PO, Alloc >::loadXMLNode(), plist::ArrayOf< PO, Alloc >::operator=(), plist::DictionaryOf< PO, Alloc >::operator=(), plist::ArrayBase::saveXML(), plist::DictionaryBase::saveXML(), plist::ArrayOf< PO, Alloc >::set(), plist::DictionaryOf< PO, Alloc >::set(), and setUnusedWarning(). The documentation for this class was generated from the following files: |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:24 2016 by Doxygen 1.6.3 |