mswMOD_LIST_MANAGER

Section: Devices and Network Interfaces (4)
Updated: 2012-04-23 10:09
Index Return to man pages list
 

NAME

mswMOD_LIST_MANAGER - Class off the TCS Mode Switching module to
                      handle and interact with the list of required
                      LCUs/Control modules

 

SYNOPSIS


#include "mswMOD_LIST_MANAGER.C"

class mswMOD_LIST_MANAGER : public evhDB_CMD_SERIAL
{
  public:
    mswMOD_LIST_MANAGER();
    mswMOD_LIST_MANAGER(const dbSYMADDRESS  dbPoint);
   ~mswMOD_LIST_MANAGER();

    ccsCOMPL_STAT        SendAll(msgMESSAGE &msg,
                                 const vltINT8 phase = mswSEND_NO_PHASE,
                                 const vltINT8 mode  = mswSEND_REQUIRED,
                                 const vltINT8 focus = 0);
    ccsCOMPL_STAT        UpdateCallbacks();
    mswMOD_RECORD_ARRAY &GetRequiredModules();
    vltLOGICAL           CheckReqModState(vltINT32 stateToCheck);
    ccsCOMPL_STAT        UpdateReqModList(vltINT8 oldFocus,vltINT8 newFocus);

  protected:
    virtual evhCB_COMPL_STAT  ListChangedCB(evtEVENT_MSG &msg, void *udata);
    virtual evhCB_COMPL_STAT  UnitStateChangedCB(msgMESSAGE &msg, void *udata);

  private:
    ccsCOMPL_STAT      ConstructorInit();
    ccsCOMPL_STAT      TriggerEvaluation(vltINT8 whatToTrigger);

    evtEVENT           evt;
    evtEVENT           unitEvent[mswNO_OF_MODULES];
    mswMOD_LIST       *modList;
    dbSYMADDRESS       modPoint;

};

 

PARENT CLASS


evhDB_CMD_SERIAL

 

DESCRIPTION


Look at the documentation for the base class evhDB_CMD_SERIAL(4) to get
information about command handling in this class, internal states and
notification of errors and completion.

This class provides methods to:
     - Send commands to a list of units, selected from a table
       based on flag values
     - Modify the list changing the flags
     - Monitor the list for changes done externaly (for example
       during maintenance).
     - Access table information

mswMOD_LIST_MANAGER requires a database support point
where the list is stored and can be assessed.
Typically this will be the msw list point in the standard TCS
mode switching database branch, i.e. ":Appl_data:TCS:msw:list".
The default value is built assuming a standard TCS database
and using the tcsDbRoot(3) function.

Commands are serialized, i.e. is a request for a new SendAll() is
performed while a command is still pending, the new request is queued
and actually performed when the pending one is completed.

Please, read the CAUTION section for limits in the implementation
of the SendAll() method.

 

PUBLIC METHODS


    mswMOD_LIST_MANAGER();
    mswMOD_LIST_MANAGER(const dbSYMADDRESS  dbPoint);
       When the object is created the database table is loaded in
       memory by calling the mswMOD_LIST_COMMAND method SetMswPoint.
       The ListChangedCB() callback is registered to monitor the
       table itself for changes occurring from outside.
       It also installs event handlers on the state database attributes
       for all the required units to call UnitStateChangedCB() whenever
       they change state.
       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.

   ~mswMOD_LIST_MANAGER();

    ccsCOMPL_STAT RefreshAndSendAll(msgMESSAGE &msg);
       Behaves like the SendAll() method, but before sending the command
       ask for a Refresh().
       In order to do this verifies that mswMIRROR units are in stand-by
       or on-line, If not, ask them to go in stand-by, then read mirror
       positions and uses this data to refresh the required's list.
       This task is accomplished calling the Refresh() protected
       method.
       If everything is OK, can send the requested command.
       THIS METHOD IS NOT YET IMPLEMENTED.

    ccsCOMPL_STAT SendAll(msgMESSAGE &msg,
                          const vltINT8 phase = mswSEND_NO_PHASE,
                          const vltINT8 mode  = mswSEND_REQUIRED,
                          const vltINT8 focus = 0);
       This method is just an interface to mswMOD_LIST_COMMAND
       Send() method.
       This method is using the overloaded Send method of mswMOD_LIST_COMMAND.

    ccsCOMPL_STAT  UpdateCallbacks();
       Method to re-install all required callback for the state
       attributes of required modules.

    mswMOD_RECORD_ARRAY  &GetRequiredModules();
       This method is just an interface to mswMOD_LIST to obtain
       the list of required modules.

    vltLOGICAL        CheckReqModState(vltINT32 stateToCheck);
       Checks if ALL the required modules are in the specified state.

    ccsCOMPL_STAT     UpdateReqModList(vltINT8 oldFocus,vltINT8 newFocus);
       Interface to the corresponding mswMOD_LIST class method.

 

PROTECTED METHODS


    evhCB_COMPL_STAT  ListChangedCB(msgMESSAGE &msg, void *udata);
       This function is called whenever the list is modified from
       outside.
       When this event occurres the DB table is reloaded into memory
       and the value of DB attribute listchanged is incremented,
       in order to create an event for mswEVAL_STATE.

    evhCB_COMPL_STAT  UnitStateChangedCB(msgMESSAGE &msg, void *udata);
       This function is called whenever the state of a required unit
       in the list changes.
       When this event occurres the value of DB attribute unitchanged
       is incremented, in order to create an event for mswEVAL_STATE.

    ccsCOMPL_STAT     Refresh();
       This is the actual function used to perform a refresh in the list
       of required LCUs and coordination modules.
       In function verifies that mswMIRROR units are in stand-by
       or on-line, If not, ask them to go in stand-by, then read mirror
       positions and uses this data to refresh the required's list.
       This has been placed as a separated protected method to make
       easier the implementation of NTT and VLT specific subclasses.
       THIS METHOD IS NOT YET IMPLEMENTED.

 

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

    ccsCOMPL_STAT   TriggerEvaluation(vltINT8 whatToTrigger);
       Generates an event for mswEVAL_STATE by incrementing the database
       attributed soecified with whatToTrigger.

 

PRIVATE DATA MEMBERS


     evtEVENT evt;
       Event to monitor external changes of the table

     evtEVENT  unitEvent[mswNO_OF_MODULES];
       Array of events for required modules state attribute

     mswMOD_LIST *modList;
       Object for handling of list

     dbSYMADDRESS modPoint;
       Point name of mode switching table

 

ON LINE DATABASE


The class need the support of an instance of the mswMOD_LIST_MANAGER
database class:

   CLASS prsDB_CMD_SERIAL mswMOD_LIST_MANAGER
 

BEGIN


         ATTRIBUTE Table modules(mswNO_OF_MODULES,
                                 BYTES32   modName,
                                 BYTES32   modId,
                                 BYTES256  modSymbAddr,
                                 int8      startPhase
                                 int8      stopPhase,
                                 int8      tracking,
                                 int8      focus,
                                 logical   required,
                                 logical   ignore,
                                 BYTES256  userField
                                )
         ATTRIBUTE int32        listchanged 0
         ATTRIBUTE int32        unitchanged 0
 

CAUTIONS


  SendAll(): Due to limitations in the current implementation,
             the phase selected in a call to SendAll() will
             be applied applied TO ALL PENDING QUEUES, and not
             only to the issued command.
             This means that it is possible to have at any
             time only a pending command and a queued command
             with a different phase. If there are more command
             queued and a new one is issued, all the queued one
             will get the same phase of newly issued Send
  RefreshAndSendAll();
  Refresh();
             These methods are not yet implemented



 

Index

NAME
SYNOPSIS
PARENT CLASS
DESCRIPTION
PUBLIC METHODS
PROTECTED METHODS
PRIVATE METHODS
PRIVATE DATA MEMBERS
ON LINE DATABASE
BEGIN
CAUTIONS

This document was created by man2html, using the manual pages.
Time: 10:09:27 GMT, April 23, 2012