tecplot::toolbox::StateChangeNotifier Class Reference

Handles State Change Notification events and passes those events on to registered listeners. More...

#include <StateChangeNotifier.h>

Inheritance diagram for tecplot::toolbox::StateChangeNotifier:

tecplot::toolbox::StateChangeNotifierInterface tecplot::toolbox::StateChangeListenerInterface

Public Member Functions

 StateChangeNotifier (StateChangeMode_e stateChangeMode=StateChangeMode_v100)
virtual ~StateChangeNotifier ()
void addListener (StateChangeListenerInterface *const listener) throw (OutOfMemoryException)
 Register a listener with the StateChangeNotifier.
void removeListener (StateChangeListenerInterface *const listener)
 Remove a listener from the StateChangeNotifier.
bool isListening (StateChangeListenerInterface *const listener)
 Checks to see if a particular listener is registered with the StateChangeNotifier.
tecplot::toolbox::StringList getStyleParams ()
 Get the supplimental style parameters associated with the last StateChange_Style notification.
std::string getStyleParam (int paramOffset)
 Get an individual style parameter which is associated with the last StateChange_Style notification.
tecplot::toolbox::Set getObjectSet ()
 Get the object set associated with the last StateChange_Style notification.
LgIndex_t getOffset1 ()
 Get the offset1 value associated with the last StateChange_Style notification.
LgIndex_t getOffset2 ()
 Get the offset2 value associated with the last StateChange_Style notification.

Protected Member Functions

virtual void stateChanged (StateChange_e stateChange)
 Override this method if you wish to do something special with the state change notification.

Detailed Description

Handles State Change Notification events and passes those events on to registered listeners.

State Change Listeners must be of type StateChangeListenerInterface.


Constructor & Destructor Documentation

tecplot::toolbox::StateChangeNotifier::StateChangeNotifier ( StateChangeMode_e  stateChangeMode = StateChangeMode_v100  ) 

virtual tecplot::toolbox::StateChangeNotifier::~StateChangeNotifier (  )  [virtual]


Member Function Documentation

void tecplot::toolbox::StateChangeNotifier::addListener ( StateChangeListenerInterface *const   listener  )  throw (OutOfMemoryException) [virtual]

Register a listener with the StateChangeNotifier.

Note:
Tecplot must be locked when calling this method. Override lockStart and lockFinish methods to provide locking as a convenience.
Parameters:
listener Pointer to the listener class that has implemented the StateChangeListenerInterface
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if listener could not be added.

Implements tecplot::toolbox::StateChangeNotifierInterface.

void tecplot::toolbox::StateChangeNotifier::removeListener ( StateChangeListenerInterface *const   listener  )  [virtual]

Remove a listener from the StateChangeNotifier.

Note:
Tecplot must be locked when calling this method. Override lockStart and lockFinish methods to provide locking as a convenience.
Parameters:
listener Pointer to the listener class that has implemented the StateChangeListenerInterface

Implements tecplot::toolbox::StateChangeNotifierInterface.

bool tecplot::toolbox::StateChangeNotifier::isListening ( StateChangeListenerInterface *const   listener  )  [virtual]

Checks to see if a particular listener is registered with the StateChangeNotifier.

Parameters:
listener Pointer to the listener class that has implemented the StateChangeListenerInterface
Returns:
true if the listener is registered, false otherwise.

Implements tecplot::toolbox::StateChangeNotifierInterface.

tecplot::toolbox::StringList tecplot::toolbox::StateChangeNotifier::getStyleParams (  ) 

Get the supplimental style parameters associated with the last StateChange_Style notification.

This information is transient and only available from the StateChange listener's stateChanged method.

Returns:
A StringList containing the P1-P5 style values associated with the StateChange_StyleEvent. This StringList only contains as many items as were included in the supplimental information. Returns an empty StringList if the last StateChange event had no supplimental information.

std::string tecplot::toolbox::StateChangeNotifier::getStyleParam ( int  paramOffset  ) 

Get an individual style parameter which is associated with the last StateChange_Style notification.

This information is transient and only available from the StateChange listener's stateChanged method.

Parameters:
paramOffset An integer offset to the desired P-value. Values of 1-5 are acceptible.
Returns:
A string containing the style paramter at the given parameter offset. An empty string is returned if there is no style parameter at the specified parameter offset.

tecplot::toolbox::Set tecplot::toolbox::StateChangeNotifier::getObjectSet (  ) 

Get the object set associated with the last StateChange_Style notification.

This information is transient and only available from the StateChange listener's stateChanged method.

Returns:
The object set associated with the previous StateChange. If no object set is associated with the previous StateChange the set will be empty.

LgIndex_t tecplot::toolbox::StateChangeNotifier::getOffset1 (  ) 

Get the offset1 value associated with the last StateChange_Style notification.

This information is transient and only available from the StateChange listener's stateChanged method.

Returns:
The offset 1 value associated with the previous StateChange. If no offset1 value is associated with the previous StateChange the result will be BAD_SET_VALUE

LgIndex_t tecplot::toolbox::StateChangeNotifier::getOffset2 (  ) 

Get the offset2 value associated with the last StateChange_Style notification.

This information is transient and only available from the StateChange listener's stateChanged method.

Returns:
The offset2 value associated with the previous StateChange. If no offset2 value is associated with the previous StateChange the result will be BAD_SET_VALUE

virtual void tecplot::toolbox::StateChangeNotifier::stateChanged ( StateChange_e  stateChange  )  [protected, virtual]

Override this method if you wish to do something special with the state change notification.

For instance you might create a custom StateChangeNotifier that only notifies of StateChange_Style notifications. Be sure to call StateChangeNotifier::stateChangeCallback to notifiy the listeners.

Parameters:
stateChange The state change notification from Tecplot Engine.
   void MyStateChangeNotifier::stateChangeCallback(StateChange_e stateChange)
   {
     if ( stateChange == StateChange_Style )
       StateChangeNotifier::stateChangeCallback(stateChange);
   }

Implements tecplot::toolbox::StateChangeListenerInterface.


Generated on Wed Dec 19 02:19:11 2007 for Tecplot by  doxygen 1.5.2-20070506