#include <DBClient.hh>
Inherits DBBase.
This class encapsulates a database client which contacts a database manager using the communications library, signs up for access to entrys, and then sets and gets those entry values appropriately. In addition, remote entries can go invalid if the database manager dies and is reborn. The client can "reestablish", i.e., sign up for the entry again, for an entry.
Public Member Functions | |
DBClient (CommManager *mgr, const char *spec, int id, int fundamental_rate, int priority=-1) | |
DBClient (CommManager *mgr, RemoteManager *dest, int id, int fundamental_rate) | |
RemoteDBEntry * | access (bool periodic, const char *name, int max_size, const char *description, unsigned int access_flags, int rate, int timeout=500) |
RemoteDBEntry * | create (bool periodic, const char *name, int max_size, const char *description, unsigned int access_flags, int rate, int timeout=500) |
RemoteDBEntry * | accessInt (bool periodic, const char *name, unsigned int access_flags, int rate, int timeout=500) |
RemoteDBEntry * | accessDouble (bool periodic, const char *name, unsigned int access_flags, int rate, int timeout=500) |
RemoteDBEntry * | createInt (bool periodic, const char *name, unsigned int access_flags, int rate, int timeout=500) |
RemoteDBEntry * | createDouble (bool periodic, const char *name, unsigned int access_flags, int rate, int timeout=500) |
RemoteManager * | getDBManager () const |
void | shutdown () |
bool | query (RemoteDBEntry *, int timeout) |
void | close (RemoteDBEntry *) |
Related Functions | |
(Note that these are not member functions.) | |
ACCESS(periodic, name, type, access_flags, rate, timeout) | |
CREATE(periodic, name, type, access_flags, rate, timeout) |
|
This constructor creates a database client whose manager is specified by spec. (all periodic operations will happen at an integer multiple of fundamental_rate milliseconds). |
|
This method attaches to entry on manager, return 0 if there, -1 if not access_flags is the OR'd value of the following flags
If periodic is true, then
If periodic is false, then
Note rate for non-periodic can be 0, which means changes are immediately propagated no matter what, but this should be used with caution for high-priority entries that will _probably_ not change often (e-stops for example). You cannot have both the DB_PUBLISH flag and the DB_SUBSCRIBE flag true at the same time. If this is the case, the entry request will be rejected and NULL will be returned. |
|
This method is a convenience function for accessing an double precision floating point entry |
|
This method is a convenience function for accessing an integer entry |
|
This method subscribes to an entry on manager, create if not there. Return 0 if successful, -1 if not. Otherwise, this has the same semantics as access |
|
This method is a convenience function for creating an double precision floating point entry |
|
This method is a convenience function for creating an integer entry |
|
This is a convenience macro for accessing entries using the same calling semantics as the create and access methods, but whose size and descriptions are are extracted using macro magic from the type name type. |
|
This is a convenience macro for creating entries using the same calling semantics as the create and access methods, but whose size and descriptions are are extracted using macro magic from the type name type. |