#include <DBBase.hh>
Inherited by DBClient, and DBManager.
List of all members.
Detailed Description
Common superclass of DBManager and DBClient.
This class is a common superclass which contains operations common between the DBManager and DBClient classes. The main point of commonality is to have a "send thread," which has a list of monitors. Each monitor is associated with a data base entry and, probably with a database client. Each monitor's update method is called periodically, which, depending on the monitor instance involved, may result in the sending of a value to the appropriate database client.
In addition, this class manages the string dictionary of the entry names, which work the same both for managers and clients.
Constructor & Destructor Documentation
DBBase::DBBase |
( |
CommManager * |
mgr, |
|
|
int |
fundamental_rate, |
|
|
int |
priority = -1 |
|
) |
|
|
|
This constructor creates a database using communications manager "mgr" with a fundamental rate "fundamental_rate". This rate indicates roughly the minimum time in milliseconds between periodic updates and the minimum rate at which immediate changes will be propagated. Both database manager and database clients create an entry monitoring subthread which runs roughly every fundamental_rate milliseconds. If priority is negative, then this sub-thread runs at a relative priority of the current thread priority plus priority. If priority is positive, then the sub-thread will run with the absolute priority priority. |
|
The destructor cleans out the database memory and shuts down the monitoring thread. |
Member Function Documentation
void DBBase::addCallback |
( |
DBEntry * |
entry, |
|
|
DBCallback * |
cb |
|
) |
|
|
|
This method adds a callback "cb" to be invoked sometime after a change to the database entry "entry". "cb" is a subclass of the abstract class DBCallback. Details of this class can be found in RHexCom/DBCallback.hh, and there is also a macro, DB_CALLBACK to help you use callbacks found in RHexCom/DBBase.hh. I will document this no more, as you shouldn't use them. |
|
This method returns the communications manager passed in at the creation of the class. |
int DBBase::getRate |
( |
|
) |
const [inline] |
|
|
This method returns the number of milliseconds which is the fundamental period of the monitoring sub-thread. |
void DBBase::updateCallbacks |
( |
|
) |
|
|
|
If, through some lack of imagination or sheer stubborness, you do use callbacks, then your main thread of operation must invoke this method periodically. The callbacks are finally invoked in this method. |
RHexLib Reference Documentation