class CAVERNdb_sharedState_c : public CAVERNmisc_observer_c Encapsulates a shared state to be maintained between multiple users
|
| CAVERNdb_sharedState_c () Class constructor. |
| | CAVERNdb_sharedState_c ( CAVERNdb_client_c *dbclient, char *path, char *key ) Class constructor |
|
| ~CAVERNdb_sharedState_c () Class destructor. |
|
| isSharingEnabled () Returns the sharing status of this state. |
|
| enableSharing () Sets the sharing enabled flag to TRUE. |
|
| disableSharing () Sets the sharing enabled flag to FALSE. |
| | refresh () Requests a refresh of the data |
|
| _packer data packing object |
|
| _dbclient pointer to a database client which will make the transmissions |
|
| _sharingEnabled flag for indicating whether or not sharing is enabled |
|
| _path path name in the database for storing this state |
|
| _key key name in the database for storing this state |
| | packAndSendState () Packs the object state and transmits it to the database server |
| | unpackState ( char *data ) Unpacks the object state from the data buffer |
Encapsulates a shared state to be maintained between multiple users. This class provides a base abstract class from which to derives shared state information which multiple users encounter. This state needs to be managed by a database client in order to maintain consistency, but the client itself is external to the scope of the state. This state is associated with a particular path and key that should not change throughout the life of the state.Updates are handled through the user of the subject-observer pattern. The shared state observes the client, so when new data arrives, it will unpack the state information provided that sharing is enabled. Sharing is initially disabled for initialization purposes, but can be enabled and disabled later as required.
Subclasses of the shared state have the responsiblity of handling the format of the state for transmission. The state will need to be packed using the packer instance and then sent through the database client. This process is handled by each client because the packing will vary, and the send is dependent upon the size of the packed data. Unpacking state information, however, can be done with just the data itself.
int refresh()
virtual int packAndSendState()
virtual int unpackState( char *data )
alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de