#include <DBEntry.hh>
Inherited by RemoteDBEntry.
List of all members.
Detailed Description
Fundamental class for entries in the database.
The DBEntry class is the fundamental class for entries in the distributed database. Each entry has a byte array of data which can be queried and set. Each entry has a name by which it is entered in the database's entry dictionary and a description key, which is the string hash of a description of the entries contents, usually the name of the structure which best defines the entry. In addition, each entry as a list of "monitors" which get updated whenever the entry gets set (to invoke callbacks or send changes to remote clients if necessary) and a list of "change sources" which get updated whenever the entry value is gotten. Each change source is defined to return a "new" change message or NULL. The set will use the most recent change, if any. If no change source is "new", the entry returns the current data.
Entries can be "locally owned" which means only the local process can change the value. Entries can also be "exclusively owned" by a remote process, which means that only that remote process can change the value, although currently the local process can still change it.
Note that database entries can be even more expensive than communication mailboxes and streams, and thus it is imperative that the database not be simply a bunch of named integers and doubles. Data that is meant to be used together should be grouped together into structures as much as possible.
Member Function Documentation
|
This method returns a pointer to a message to use to set the entry data. |
virtual Message* DBEntry::get |
( |
|
) |
[virtual] |
|
|
This method returns a pointer to the message which contains the entry's data. It uses Message system from communications manager to reduce the amount of copying and allocating. |
unsigned int DBEntry::getDescriptionKey |
( |
|
) |
const [inline] |
|
|
This method returns the result of running a hash function on the entry's description string. |
double DBEntry::getDouble |
( |
|
) |
|
|
|
This is a convenience method for accessing data entries which just contain double precision floating point numbers. |
|
This is a convenience method for accessing data entries which just contain integers. |
int DBEntry::getMaxSize |
( |
|
) |
[inline] |
|
|
This method returns the maximum size of the entry data. |
const char* DBEntry::getName |
( |
|
) |
const [inline] |
|
|
This method returns the name of the entry as it is entered in the database. |
template<class T> |
bool DBEntry::getStruct |
( |
T * |
val |
) |
|
|
|
This is a templated convenience method for accessing data entries which contain a flat structure of type "T". |
void DBEntry::release |
( |
Message * |
|
) |
|
|
|
This method releases the message gotten by the get method (or, if necessary by the createData method, although that will be very uncommon). |
virtual bool DBEntry::set |
( |
Message * |
|
) |
[virtual] |
|
|
This method sets the entry data using the data in "msg"; |
bool DBEntry::setDouble |
( |
double |
d |
) |
|
|
|
This is a convenience method for setting data entries which just contain double precision floating point numbers. |
bool DBEntry::setInt |
( |
int |
i |
) |
|
|
|
This is a convenience method for setting data entries which just contain integers. |
template<class T> |
bool DBEntry::setStruct |
( |
T * |
val |
) |
|
|
|
This is a templated convenience method for setting data entries which contain a flat structure of type "T". |
RHexLib Reference Documentation