CStateMonitor

Name

CStateMonitor -- State monitor with callbacks.

Synopsis


#include <CStateMonitor.h>
       CStateMonitor : public CStateManagerBase
      
  CStateMonitor((std::string transitionRequestUri, std::string statePublisherUri, CStaeMonitorBase::InitCallback cb = 0)
          throws ;
      
  virtual  void Register(std::string state, Callback cb, void* cbarg)
          throws ;
  
        virtual  void unregister(std::string state)
          throws ;
  
     
     
   

DESCRIPTION

Derived from CStateMonitorBase the CStateMonitor provides a fully functional state monitor class that allows its clients to regiser callbacks to be exeuted when states are entered.

METHODS

CStateMonitor((std::string transitionRequestUri, std::string statePublisherUri, CStaeMonitorBase::InitCallback cb = 0) throws ;

Constructs the CStateMonitor See classname for information about the constructor's parameters as they are the same as for that classs.

virtual void Register(std::string state, Callback cb, void* cbarg) throws ;

Registers interest in a state the cb callback is invoked if the state is either entered by transition from a known state or if the state is the one the system is discovered to be in at startup time.

See TYPES for information about the Callack type. When the cb is called, one of the paramters it is passed is the cbarg passed in at registration time.

virtual void unregister(std::string state) throws ;

This unregisters any callback established for state

TYPES

Callback

This type is a function pointer to functinos that are suitable as callback functions. The type has the following definition:

typdef void (*Callback) ( CStateMonitor* pMonitor std::string prior std::string current );

pMonitor points to the CStateMonitor that called the callback. prior is the prior state and is an empty string if it is not known. current is the state the system is now transitioned to.