mswEVAL_STATE
Section: Devices and Network Interfaces (4)
Updated: 2012-04-23 10:09
Index
Return to man pages list
NAME
mswEVAL_STATE - Class of the TCS Mode Switching module to evaluate
TCS Global State
SYNOPSIS
#include "mswEVAL_STATE.h"
class mswEVAL_STATE : public evhDB_TASK
{
public:
mswEVAL_STATE(mswMOD_LIST_MANAGER &listManager);
mswEVAL_STATE(const dbSYMADDRESS dbPoint,
mswMOD_LIST_MANAGER &listManager);
~mswEVAL_STATE();
ccsCOMPL_STAT Disable();
ccsCOMPL_STAT Enable();
vltLOGICAL Enabled();
ccsCOMPL_STAT Evaluate();
ccsCOMPL_STAT SubState(vltINT32 substate);
vltINT32 SubState();
protected:
evhCB_COMPL_STAT RequiredListChangedCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT StateChangedCB(evtEVENT_MSG &msg, void *udata);
private:
ccsCOMPL_STAT ConstructorInit();
evtEVENT evtList;
evtEVENT evtUnit;
mswMOD_LIST_MANAGER &modListManager;
vltLOGICAL enabled;
};
PARENT CLASS
evhDB_TASK
DESCRIPTION
This class is used to evaluate (when enabled) the state and substate
of TCS based on the states of the required or anyway involved
LCUs and coordination modules.
It is a support class for the mswCONTROL_MAIN class and assumes that
the given const dbSYMADDRESS dbPoint database address contains
attributes for the state and substate values (then it shares the same
database point with mswCONTROL_MAIN).
It will receive in this parameter the database address for the instance
of mswCONTROL_MAIN.
In order to easily get the list of required LCUs, needs the support
of an instance of mswMOD_LIST_MANAGER class, that is passed by
reference on the constructor.
Any changes detected by the mswMOD_LIST_MANAGER class are transferred
to this class by means of events of two dedicated attributes
listchanged and unitchanged.
PUBLIC METHODS
mswEVAL_STATE(mswMOD_LIST_MANAGER &listManager);
mswEVAL_STATE(const dbSYMADDRESS dbPoint,
mswMOD_LIST_MANAGER &listManager);
Creates the object.
Two constructors are provided.
The second one receives as parameter the symbolic address of
online database support point for the object, i.e. the point
where the object can find configuration and run time values.
The first one defines the online database support point calling
the standard tcsDbRoot(4) function and appenting the
default relative path from the TCS database root point,
assuming a complete default TCS database structure.
This point is assumed to have a "state" and "substate"
attributes.
~mswEVAL_STATE();
ccsCOMPL_STAT Disable();
Disable evaluation of state up to the next call to Enable()
ccsCOMPL_STAT Enable();
Enable evaluation of state up to the next call to Disable()
It calls always Evaluate method.
vltLOGICAL Enabled();
Returns TRUE if evaluation of the state is enabled, FALSE if it
is disabled.
ccsCOMPL_STAT Evaluate();
Evaluates the new values for state and substate and updates the database.
This task is performed by asking the instance of mswMOD_LIST_MANAGER
for the database addresses of the LCUs and coordinating modules and
then reading their states. The new TCS state is based on these values and
on the TCS's current state.
The new state is written in the corresponding database attribute.
The algorithm for TCS Global state is as follow:
if any required module is UNDEFINED or OFF or LOADED
then global state = OFF
else if all required modules are ONLINE
then global state = ONLINE
else global state = STANDBY
ccsCOMPL_STAT SubState(vltINT32 substate);
Support method to write TCS global substate to the database.
vltINT32 SubState();
Support method to read TCS global substate from the database.
PROTECTED METHODS
evhCB_COMPL_STAT RequiredListChangedCB(msgMESSAGE &msg, void *udata);
This callback is called by an event from mswMOD_LIST_MANAGER.
It updates the state callbacks and if evaluation is enabled
recalculates TCS global state.
evhCB_COMPL_STAT StateChangedCB(msgMESSAGE &msg, void *udata);
This callback is called by an event from mswMOD_LIST_MANAGER.
It recalculates TCS global state if evaluation is enabled.
PRIVATE METHODS
ccsCOMPL_STAT ConstructorInit();
Support method called by the constructors to grup in a single
place code that would have been otherwise copied in all constructors
PRIVATE DATA MEMBERS
evtEVENT evtList;
Event object used for required list changed
evtEVENT evtUnit;
Event object used for state changed
mswMOD_LIST_MANAGER &modListManager;
Object to get support from modlist manager
vltLOGICAL enabled;
Flag to indicate if evaluation is enabled or disabled
ON LINE DATABASE
The database support point for this class is assumed to have
the following attributes:
ATTRIBUTE int32 state
ATTRIBUTE int32 substate
It has not been defined a specific database class but the reference
is the mswCONTROL_MAIN database class
RETURN VALUES
mswEVAL_STATE_DISABLED If requested state evaluation while disabled
Index
- NAME
-
- SYNOPSIS
-
- PARENT CLASS
-
- DESCRIPTION
-
- PUBLIC METHODS
-
- PROTECTED METHODS
-
- PRIVATE METHODS
-
- PRIVATE DATA MEMBERS
-
- ON LINE DATABASE
-
- RETURN VALUES
-
This document was created by
man2html,
using the manual pages.
Time: 10:09:27 GMT, April 23, 2012