In file PlotSet/PlotSet.hh:

class PlotSet

Plot set or pool

Inheritance:


Public Classes

class PlotFilter
Plot filter object.
PlotFilter ()
Default constructor.
virtual bool operator) (const PlotDescriptor& pd, std::string& g, std::string& a, std::string& b) const
Evaluate filter.
class iterator : public basic_iterator
Plot pool iterator.
explicit iterator (const PlotListLink* g = 0)
Default constructor.
iterator& operator++ ()
Increment operator.
iterator operator++ (int)
Increment operator.
PlotDescriptor& operator* ()
Dereference operator.
PlotDescriptor* operator-> ()
Dereference operator.
class const_iterator : public basic_iterator
Plot pool const_iterator.
explicit const_iterator (const PlotListLink* g = 0)
Default constructor.
const_iterator& operator++ ()
Increment operator.
const_iterator operator++ (int)
Increment operator.
const PlotDescriptor& operator* () const
Dereference operator.
const PlotDescriptor* operator-> () const
Dereference operator.

Public Fields

typedef std::list <VirtualPlotPad*> padlist
Plot pad list
typedef std::list <VirtualPlotWindow*> winlist
Plot pad list

Public Methods

static const PlotFilter& NoFilter ()
Returns a reference to filter with passes everything
PlotSet ()
Default constructor.
virtual ~PlotSet ()
Destructor.
virtual void Merge (PlotSet& pl, const PlotFilter& filter = NoFilter())
Merge plot set method.
virtual void RegisterWindow (VirtualPlotWindow* win)
Register window method.
virtual void UnregisterWindow (VirtualPlotWindow* win)
Unregister window method.
virtual const winlist* GetRegisteredWindows ()
Get window list method.
virtual void RegisterPad (VirtualPlotPad* pad)
Register pad method.
virtual void UnregisterPad (VirtualPlotPad* pad)
Unregister pad method.
const PlotMap& GetPlotMap () const
Get plot list method.
virtual iterator begin ()
Begin method.
virtual const_iterator begin () const
Begin method.
virtual iterator end ()
Begin method.
virtual const_iterator end () const
Begin method.
virtual const PlotDescriptor* Get (const char* graphtype, const char* Achn, const char* Bchn = 0) const
Get plot descriptor method.
virtual PlotDescriptor* Add (PlotDescriptor* plotd)
Add plot descriptor method.
virtual PlotDescriptor* Add (BasicDataDescriptor* desc, const char* graphtype, const char* Achn, const char* Bchn = 0, const ParameterDescriptor* prmd = 0, const calibration::Descriptor* cald = 0)
Add data descriptor method.
virtual PlotDescriptor* Add (const AttDataDescriptor& data, const char* graphtype = 0, const char* Achn = 0, const char* Bchn = 0)
Add user data method.
virtual void Remove (const PlotDescriptor* plotd, bool deleteIt = true)
Remove plot descriptor method.
virtual void Clear (bool all = true)
Clear plot descriptor method.
virtual bool Empty () const
Is empty method.
virtual void Update (const PlotDescriptor* plotd) const
Update method.
virtual void Update () const
Update method.

Protected Classes

class basic_iterator
Plot pool basic iterator.
friend class PlotSet
PlotSet is a friend
explicit basic_iterator (const PlotListLink* g = 0)
Default constructor.
bool operator== (const basic_iterator& iter) const
Equal operator.
bool operator!= (const basic_iterator& iter) const
Unequal operator.
basic_iterator& operator++ ()
Increment operator.
basic_iterator operator++ (int)
Increment operator.

Protected Fields

PlotMap fPlotList
List tree of plot descriptors
winlist fMainWindows
List of registered main windows (all registered windows are automatically closed when the plot set is deleted
padlist fPads
List of registered graphics pads (all registered pads are automatically updated when update is called

Documentation

Describes a pool(set) of plot descriptors. A pool also maintains a list of plot pads currently using data from the pool and a list of main windows currently displaying a plot from the pool. Typically, a user will create his/her own plot pool or use the global instance (defined in TLGPlot). User data object which were made 'plot aware' by inheriting from AttDataDescriptor can be added to the pool directly, as well as data descriptors with an associated graph type and channel name(s). Using a plot pool has the advantage that multiple plots can be provided to the user through a single pad. The user may choose to display any plot from the pool as he/she wishes.

When the data of a user data object or data descriptor is changed, the user has to call the Update routines of either the changed objects or the one of the pool to display the new data.

When a plot pool is deleted all asscoiated plot windows are destroyed as well.

Unless the data descriptor carries a copy of the data the original data obejct (or arrays) must stay valid until either the plot set is deleted or the assciated plot decriptor removed from the pool.

Plot descriptors are stored by their graph type and channel names. Hence, the combination of graph type, A channel name and optionally B channel name must be unique.

User code typically only uses the Add, Remove and Update methods.

typedef std::list <VirtualPlotPad*> padlist
Plot pad list

typedef std::list <VirtualPlotWindow*> winlist
Plot pad list

class basic_iterator
Basic iterator for plot pool. Iterators become invalid if the plot gets changed.

explicit basic_iterator(const PlotListLink* g = 0)
Constructs a plot pool iterator.
Returns:
void

bool operator== (const basic_iterator& iter) const
Compares two plot pool iterators.
Returns:
true if equal
Parameters:
iter - Iterator to compare

bool operator!= (const basic_iterator& iter) const
Compares two plot pool iterators.
Returns:
true if equal
Parameters:
iter - Iterator to compare

basic_iterator& operator++()
Increment a pool iterators.
Returns:
original iterator

basic_iterator operator++(int)
Increment a pool iterators.
Returns:
incremented iterator

PlotMap fPlotList
List tree of plot descriptors

winlist fMainWindows
List of registered main windows (all registered windows are automatically closed when the plot set is deleted

padlist fPads
List of registered graphics pads (all registered pads are automatically updated when update is called

class PlotFilter
Plot filter object. Its function operator is used to apply the filter function.

PlotFilter()
Constructs a plot filter.
Returns:
void

virtual bool operator) (const PlotDescriptor& pd, std::string& g, std::string& a, std::string& b) const
Evaluates the filter function. The filter also passes graphics type and channel names; they can be changed by the filter function to resolve naming conflicts between the two plot sets.
Returns:
true if plot descriptor passed the filter
Parameters:
pl - Plot descriptor under test
g - graph typeto be used (by default the same as pd)
a - A channel name to be used (by default the same as pd)
b - B channel name to be used (by default the same as pd)

static const PlotFilter& NoFilter()
Returns a reference to filter with passes everything

class iterator: public basic_iterator
Iterator for plot pool. Iterators become invalid if the plot gets changed.

explicit iterator(const PlotListLink* g = 0)
Constructs a plot pool iterator.
Returns:
void

iterator& operator++()
Increment a pool iterators.
Returns:
original iterator

iterator operator++(int)
Increment a pool iterators.
Returns:
incremented iterator

PlotDescriptor& operator*()
Dereference a pool iterators.
Returns:
incremented iterator

PlotDescriptor* operator->()
Dereference a pool iterators.
Returns:
incremented iterator

class const_iterator: public basic_iterator
Const iterator for plot pool. Iterators become invalid if the plot gets changed.

explicit const_iterator(const PlotListLink* g = 0)
Constructs a plot pool iterator.
Returns:
void

const_iterator& operator++()
Increment a pool iterators.
Returns:
original iterator

const_iterator operator++(int)
Increment a pool iterators.
Returns:
incremented iterator

const PlotDescriptor& operator*() const
Dereference a pool iterators.
Returns:
incremented iterator

const PlotDescriptor* operator->() const
Dereference a pool iterators.
Returns:
incremented iterator

PlotSet()
Constructs a plot pool.
Returns:
void

virtual ~PlotSet()
Destructs the plot pool. All associated graphics windows are destroyed as well.
Returns:
void

virtual void Merge(PlotSet& pl, const PlotFilter& filter = NoFilter())
Merges the specified plot seto with the current one, transferring only plot descriptors approved by the filter function. By default all plot descriptors pass the filter.
Returns:
void
Parameters:
pl - Plot set to merge
filter - Plot descriptor filter

virtual void RegisterWindow(VirtualPlotWindow* win)
Registers a main window. This method is used by TLGPadMain.
Returns:
void
Parameters:
win - Window handle

virtual void UnregisterWindow(VirtualPlotWindow* win)
Unregisters a main window. This method is used by TLGPadMain.
Returns:
void
Parameters:
win - Window handle

virtual const winlist* GetRegisteredWindows()
Returns the list of registered windows.
Returns:
Window list

virtual void RegisterPad(VirtualPlotPad* pad)
Registers a plot pad. This method is used by TLGPad.
Returns:
void
Parameters:
pad - Pad handle

virtual void UnregisterPad(VirtualPlotPad* pad)
Unregisters a plot pad. This method is used by TLGPad.
Returns:
void
Parameters:
pad - Pad handle

const PlotMap& GetPlotMap() const
Returns the list of plot descriptors.
Returns:
void

virtual iterator begin()
Returns the begin iterator.
Returns:
iterator

virtual const_iterator begin() const
Returns the begin const_iterator.
Returns:
iterator

virtual iterator end()
Returns the end iterator.
Returns:
iterator

virtual const_iterator end() const
Returns the end const_iterator.
Returns:
iterator

virtual const PlotDescriptor* Get(const char* graphtype, const char* Achn, const char* Bchn = 0) const
Get plot descriptor method.
Returns:
Plot descriptor
Parameters:
graphtype - Graph type
Achn - A channel
Bchn - B channel

virtual PlotDescriptor* Add(PlotDescriptor* plotd)
Adds a plot descriptors to the pool. The plot descriptor is adopted by the pool.
Returns:
Plot descriptor, or 0 if failed
Parameters:
plotd - Plot descriptor to be added

virtual PlotDescriptor* Add(BasicDataDescriptor* desc, const char* graphtype, const char* Achn, const char* Bchn = 0, const ParameterDescriptor* prmd = 0, const calibration::Descriptor* cald = 0)
Adds a data descriptors to the pool. The data descriptor is adopted the pool. The caller must specify graph type and A channel name. If necessary a B channel can be specified as well.
Returns:
Plot descriptor, or 0 if failed
Parameters:
desc - Data descriptor to be added
graphtype - Graph type
Achn - A channel name
Bchn - B channel name (optional)
prmd - Set of parameters (optional)
cald - Set of calibration records (optional)

virtual PlotDescriptor* Add(const AttDataDescriptor& data, const char* graphtype = 0, const char* Achn = 0, const char* Bchn = 0)
Adds a user data object to the pool. The user data object must be derived from AttDataDescriptor to make it work. The plot will use the specified graph type and channel names, if they are supplied. If not it will query the user data object. The routine will faile if neither of them is specified.
Returns:
Plot descriptor, or 0 if failed
Parameters:
data - User data object to be added
graphtype - Graph type (optional)
Achn - A channel name (optional)
Bchn - B channel name (optional)

virtual void Remove(const PlotDescriptor* plotd, bool deleteIt = true)
Removes a plot descriptors from the pool. The plot descriptor is deletd if deleteIt is true.
Returns:
void
Parameters:
plotd - Plot descriptor to be removed
deleteIt - automatically deletes the plot descriptor if true (default)

virtual void Clear(bool all = true)
Removes all plot descriptors from the pool. The plot descriptors are deleted. If all is set to false, plot descriptors with the persistent flag set are not deleted.
Returns:
void

virtual bool Empty() const
True if plot set is empty.
Returns:
True if empty

virtual void Update(const PlotDescriptor* plotd) const
Updates all plot pads which are displaying data from the pool. If a plot descriptor is specfied only pads which are currently using this descriptor will be updated, otherwise all pads which have registered are updated. The option panels are not updated.
Returns:
void
Parameters:
Plot - descriptor whose data has changed

virtual void Update() const
Updates all plot pads which are displaying data from the pool. The option pannels will be updated as well.
Returns:
void


This class has no child classes.
Author:
Written November 1999 by Daniel Sigg
Version:
1.0

alphabetic index hierarchy of classes


Please send questions and comments to zweizig_j@ligo.caltech.edu


generated by doc++