DBLink Class Reference
|
Ratpac-two
|
#include <DBLink.hh>
Detailed Description
Link to RATDB table
The DBLink class provides indirect access to a table in RATDB. If you are familiar with SQL databases, the link is very much like a cursor. Normally, you will not construct a DBLink object yourself, but rather obtain a "smart pointer" to one via the DB::GetLink() method. Once you have a DBLinkPtr, you can use it just like a normal pointer to a DBLink object.
In order to access a field in the table, you will use one of the Get methods. You must know the data type of the field you are trying to access. If you try to retrieve a float field using GetI(), then a DBNotFoundError exception will be thrown. (In principle that means you could have two fields of different types with the same name, but you should NEVER EVER DO THAT.)
Implementation notes:
Note that none of the Get methods in this class are declared const to allow for the possibility of caching the results inside this object.
The reason for the indirection of a link to a table is to allow for more flexibility implementing the backends, which will someday be a mixture of text files and a SQL database. The link will then be able to provide local caching (for speed) and the ability to move around in time ("show me the data I would have gotten on Feb. 3"). None of that fanciness exists yet, so for now you will have to be content with the awesome power of being able to load an array.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/db/include/RAT/DBLink.hh
Generated by