#include <vos/metaobjects/property/db_property.hh>
Inheritance diagram for DBProperty:
By itself this doesn't do anything; use a subclass like PGDBProperty (For Postgres databases). This class is intended to be subclassed in order to implement VOS/database bridges with various SQL-based database systems. Subclasses will have to implement the actual updateToDB() and updateFromDB(), and methods, and the open() method to connect to the database. See database-specific classes for full usage details but the basic idea is that the constructor should open a connection to the database, and create the associated table and columns if they don't exist, or just fetch the existing values if they do. write() and replace() immediately update the database with new data, but read() only returns cached data. updateFromDB() will get values from the database and replace cached data, and send property-update messages to all property listeners and remote objects. Some mechanism should be set up to call this function when necesary If the database backend has no such functionality, then the the subclass should extend read() to do an update before a read, and also periodically call updateFromDB() in case it changes.
Use init() to set up the queries used to read and write to the database.
Subclasses of DBProperty should open the database connection (in init), and actually do the communication with the database.
Definition at line 60 of file db_property.hh.
|
basic constructor
Definition at line 88 of file db_property.hh. Referenced by new_DBProperty(). |
|
Set up query strings, for getting or changing both data value and data type. In the update queries, d will be replaced by property data, and t will be replaced by the datatype. These query strings should be in the format applicable to the implementation subclass you are using.
Definition at line 53 of file db_property.cc. |
|
Set up query strings, for getting or changing just data, with constant data type.
Definition at line 46 of file db_property.cc. |
|
Use given values to construct standard (I think) SQL query strings.
Definition at line 64 of file db_property.cc. |
|
called by factory to create a new instance
Definition at line 94 of file db_property.hh. Referenced by registerExtenders(). |
|
open database. this method must be overridden in implementation subclasses. Definition at line 151 of file db_property.hh. |
|
perform a query on the database (in the implementation's language; e.g. SQL) This method must be overridden in implementation subclasses. This method may throw range_error if there is an error in the query-string substiution. TODO: how shall non-scalars be returned? Reimplemented in PGDBProperty. Definition at line 160 of file db_property.hh. |
|
Register MetaObject extender for DBProperty. You must also call Property::registerExtenders() for stuff to work!. Reimplemented from Property. Reimplemented in PGDBProperty. Definition at line 100 of file db_property.hh. |
|
change all the property data, and datatype (updated in DB)
Reimplemented from LocalProperty. Definition at line 144 of file db_property.hh. |
|
fetch stuff from database and do a replace.
Definition at line 73 of file db_property.cc. |
|
write current data and type to DB.
Definition at line 91 of file db_property.cc. |
|
change property data, starting at given byte (updated in DB)
Reimplemented from LocalProperty. Definition at line 138 of file db_property.hh. |
|
Definition at line 76 of file db_property.hh. Referenced by init(). |
|
Definition at line 68 of file db_property.hh. Referenced by init(), and init_components(). |
|
Definition at line 66 of file db_property.hh. Referenced by init(), and init_components(). |
|
Definition at line 67 of file db_property.hh. Referenced by init(), and init_components(). |
|
Definition at line 73 of file db_property.hh. Referenced by init(), and init_components(). |
|
Definition at line 71 of file db_property.hh. Referenced by init(), and init_components(). |
|
Definition at line 72 of file db_property.hh. Referenced by init(). |