Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

plist::PrimitiveBase Class Reference

#include <plistBase.h>

Inheritance diagram for plist::PrimitiveBase:

Inheritance graph
[legend]
List of all members.

Detailed Description

Provides common functionality to all primitive value classes (implemented in a templated subclass Primitive).

This class supports callbacks upon modification through the use of the PrimitiveListener 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)

Definition at line 188 of file plistBase.h.

Public Member Functions

 PrimitiveBase ()
 constructor
 PrimitiveBase (const PrimitiveBase &pb)
 copy constructor (don't copy listeners)
PrimitiveBaseoperator= (const PrimitiveBase &pb)
 assignment (don't assign listeners)
 ~PrimitiveBase ()
 destructor
virtual void set (const std::string &str)=0
 assign a new value
virtual std::string get () const =0
 return current value as a string
virtual std::string toString () const
 return current value as a string
virtual void addPrimitiveListener (PrimitiveListener *vl)
 get notified of changes; be sure to call removeValueListener before destructing vl!
virtual void removePrimitiveListener (PrimitiveListener *vl)
 no longer take notification of changes to this object's value
virtual bool isPrimitiveListener (PrimitiveListener *vl)
 test if l is currently registered as a listener

Protected Member Functions

virtual void fireValueChanged () const
 run through primitiveListeners, calling PrimitiveListener::plistValueChanged(*this)

Protected Attributes

std::list< PrimitiveListener * > * primitiveListeners
 stores a list of the current listeners

Classes

struct  conversion_policy


The documentation for this class was generated from the following files:

Tekkotsu v3.0
Generated Fri May 11 20:09:07 2007 by Doxygen 1.4.7