mswINS_DATA_MONITOR
Section: Devices and Network Interfaces (4)
Updated: 2012-04-23 10:09
Index
Return to man pages list
NAME
mswINS_DATA_MONITOR - Access class to instrument configuration data
with event handling on change
PARENT CLASS
public mswINS_CONFIG_DATA
DESCRIPTION
This class is part of the TCS-public msw library and provides
access for TCS applications to instrument configuration data.
On top of features to access the msw instrument database
consiguration table, inherited from the base class
mswINS_CONFIG_DATA, it allows to install/define a callback
to be called when the configuration of the currently
selected instrument changes.
This is implemented attaching an event on ANY WRITE on the database
attribute containing the ID of the currently selected instrument.
The class mswINS_CONFIG_TABLE(4) used by the msw module to handle
the instrument data configuration takes care of updating this attribute
whenever necessary.
PUBLIC METHODS
mswINS_DATA_MONITOR(const dbSYMADDRESS dbPoint = dbEMPTY);
The constructor provides a default value for the dbPoint
parameter to behave like two distinct constructors: one with
no parameters and one with a dbPoint parameter.
The first one defines the online database support point calling
the standard tcsDbRoot(4) function and appending the
default relative path from the TCS database root point,
assuming a complete default TCS database structure.
This is what will be generally used.
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.
This will be typically used for testing purposes.
When the object is created, the event is immediately attached
and the object is ready to handle events.
virtual ~mswINS_DATA_MONITOR();
The descructor cleans-up the object and detach the event
ccsCOMPL_STAT DbPoint(const dbSYMADDRESS point);
virtual const char *DbPoint() const;
The methods of the base class to access the symbolic address of
the base point have been overwritten to implement detach of the event
on the old attribute and attach on the new one.
virtual ccsCOMPL_STAT Action(evhCALLBACK &cb);
This method is used to dynamically define a callback to be executed
when the event for new instrument configuration data occurrs.
The method can be used to change the callback on the fly.
This technique of handling the events is typically used when an
instance of the mswINS_DATA_MONITOR class is created as a data member
of the object that has to handle the event.
In this case the callback will be typically a method of the class
containing the instance of mswINS_DATA_MONITOR.
PROTECTED METHODS
virtual int _ActionCB(msgMESSAGE &msg, void *udata);
This method if the implementation of the real callback installed
in the event handler for the new instrument configuration data
event.
In this default implementation it just calls the callback installed
via the Action() method and performs some basic clean-up.
This implementation can be changed in sub-classes overwriting the
method.
This technique of handling the events is typically used when an
instance of a sub-class of the mswINS_DATA_MONITOR class is
created in order to directly handle the received event.
In this case the implementation of the callback will handle directly
all the operations necessary when instrument configuration changes.
PRIVATE DATA MEMBERS
evtEVENT evt; // Database event handling object
evhCALLBACK *actionCb; // Storage for the handling callback structure
ON LINE DATABASE
These members are used to store the values retrieved by
InsId() and InsData() methods.
They can change at the next call of the methods, so the user
must copy them upon return.
The class assumes that the database support point is a subclass
of mswINS_CONFIG_DATA, with the following structure:
CLASS BASE_CLASS mswINS_CONFIG_DATA \\
BEGIN \\
ATTRIBUTE BYTES32 selectedIns "NONE" \\
ATTRIBUTE Table data( mswNO_OF_INSTRUMENTS, \\
BYTES32 insId, \\
..... \\
) \\
END \\
The detailed definition of the table record format is important only
for the class mswINS_DATA_RECORD(4); look there for details.
SEE ALSO
eccsERROR_CLASS(4), mswINS_CONFIG_DATA(4)
Index
- NAME
-
- PARENT CLASS
-
- DESCRIPTION
-
- PUBLIC METHODS
-
- PROTECTED METHODS
-
- PRIVATE DATA MEMBERS
-
- ON LINE DATABASE
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 10:09:27 GMT, April 23, 2012