|
| enum | FieldType {
NOTFOUND
, INTEGER
, DOUBLE
, BOOLEAN
,
STRING
, INTEGER_ARRAY
, DOUBLE_ARRAY
, BOOLEAN_ARRAY
,
STRING_ARRAY
, EMPTY_ARRAY
, JSON
} |
| |
◆ FieldType
Data type of field.
| Enumerator |
|---|
| NOTFOUND | Type for fields that don't exist
|
◆ DBTable() [1/3]
◆ DBTable() [2/3]
Create new table from json object.
◆ DBTable() [3/3]
| DBTable::DBTable |
( |
std::string |
tblname, |
|
|
std::string |
index = "" |
|
) |
| |
Create new table with specific name and index.
◆ ~DBTable()
◆ Get()
template<typename T >
| T RAT::DBTable::Get |
( |
const std::string & |
name | ) |
const |
|
inline |
Template version of the Get method.
Provided as a convenience to the DBLink implementation. Fetches field based on type of T.
◆ GetD()
| double DBTable::GetD |
( |
const std::string & |
name | ) |
const |
Get value of double field.
- Warning
- Due to the hash table implementation used here, this method raises an assertion error if
name is not a valid field. Always use GetFieldType() to check if field exists if you are not sure!
◆ GetDArray()
| std::vector< double > DBTable::GetDArray |
( |
const std::string & |
name | ) |
const |
Get value of double array field.
- Warning
- Due to the hash table implementation used here, this method raises an assertion error if
name is not a valid field. Always use GetFieldType() to check if field exists if you are not sure!
◆ GetFieldList()
| std::vector< std::string > DBTable::GetFieldList |
( |
| ) |
const |
Get a vector of field names. Call GetFieldType() to determine the type of each.
◆ GetFieldType()
Get data type of field in this table.
- Returns
- DBTable::NOTFOUND if the field does not exist, otherwise returns field type.
◆ GetI()
| int DBTable::GetI |
( |
const std::string & |
name | ) |
const |
Get value of integer field.
- Warning
- Due to the hash table implementation used here, this method raises an assertion error if
name is not a valid field. Always use GetFieldType() to check if field exists if you are not sure!
◆ GetIArray()
| std::vector< int > DBTable::GetIArray |
( |
const std::string & |
name | ) |
const |
Get value of integer array field.
- Warning
- Due to the hash table implementation used here, this method raises an assertion error if
name is not a valid field. Always use GetFieldType() to check if field exists if you are not sure!
◆ GetJSON()
| json::Value DBTable::GetJSON |
( |
const std::string & |
name | ) |
const |
Get a JSON value for any field.
This returns a json::Value for any field. This includes arbitrary JSON values that cannot be parsed by RATDB into standard C++ types.
◆ GetRunBegin()
| int RAT::DBTable::GetRunBegin |
( |
| ) |
const |
|
inline |
Get run number for which this table is valid.
◆ GetRunEnd()
| int RAT::DBTable::GetRunEnd |
( |
| ) |
const |
|
inline |
Get run number for which this table is valid.
◆ GetS()
| std::string DBTable::GetS |
( |
const std::string & |
name | ) |
const |
Get value of string field.
- Warning
- Due to the hash table implementation used here, this method raises an assertion error if
name is not a valid field. Always use GetFieldType() to check if field exists if you are not sure!
◆ GetSArray()
| std::vector< std::string > DBTable::GetSArray |
( |
const std::string & |
name | ) |
const |
Get value of string array field.
- Warning
- Due to the hash table implementation used here, this method raises an assertion error if
name is not a valid field. Always use GetFieldType() to check if field exists if you are not sure!
◆ GetValidRuns()
| std::vector< int > DBTable::GetValidRuns |
( |
| ) |
const |
Get list of runs for which this table is valid.
◆ GetZ()
| bool DBTable::GetZ |
( |
const std::string & |
name | ) |
const |
Get value of bool field.
- Warning
- Due to the hash table implementation used here, this method raises an assertion error if
name is not a valid field. Always use GetFieldType() to check if field exists if you are not sure!
◆ GetZArray()
| std::vector< bool > DBTable::GetZArray |
( |
const std::string & |
name | ) |
const |
Get value of bool array field.
- Warning
- Due to the hash table implementation used here, this method raises an assertion error if
name is not a valid field. Always use GetFieldType() to check if field exists if you are not sure!
◆ IsDefault()
| bool DBTable::IsDefault |
( |
| ) |
const |
Returns true if validity range flags this as a default-plane table.
◆ IsUser()
| bool DBTable::IsUser |
( |
| ) |
const |
Returns true if validity range flags this as a user-plane table.
◆ IsValidRun()
| bool DBTable::IsValidRun |
( |
const int |
run | ) |
|
Returns true if this table is valid for the run given
◆ Set()
template<typename T >
| void RAT::DBTable::Set |
( |
const std::string & |
name, |
|
|
const T & |
value |
|
) |
| |
|
inline |
◆ SetDArrayDeferred()
| void RAT::DBTable::SetDArrayDeferred |
( |
std::string |
name, |
|
|
DBFieldCallback * |
callback |
|
) |
| |
|
inline |
Set a deferred double array field that will be fetched on demand
◆ SetDefault()
| void RAT::DBTable::SetDefault |
( |
| ) |
|
|
inline |
Set this as a default table
◆ SetIArrayDeferred()
| void RAT::DBTable::SetIArrayDeferred |
( |
std::string |
name, |
|
|
DBFieldCallback * |
callback |
|
) |
| |
|
inline |
Set a deferred integer array field that will be fetched on demand
◆ SetRunList()
| void DBTable::SetRunList |
( |
std::vector< int > |
_run_list | ) |
|
Set run list for which this table is valid.
◆ SetRunRange()
| void RAT::DBTable::SetRunRange |
( |
int |
_run_begin, |
|
|
int |
_run_end |
|
) |
| |
|
inline |
Set run range for which this table is valid. Begin and end are inclusive
◆ SetUser()
| void RAT::DBTable::SetUser |
( |
| ) |
|
|
inline |
Set this as a user-override table
◆ UsesRunList()
| bool RAT::DBTable::UsesRunList |
( |
| ) |
const |
|
inline |
Returns true if this table uses run list instead of range
◆ arrayTypeCache
Stores the data type of homogeneous arrays to make GetFieldType easier
◆ datbl_deferred
Hashtable storage of callbacks for deferred integer array fields.
◆ iatbl_deferred
Hashtable storage of callbacks for deferred integer array fields.
◆ index
| std::string RAT::DBTable::index |
|
protected |
◆ run_begin
| int RAT::DBTable::run_begin |
|
protected |
First run in which this table is valid
◆ run_end
| int RAT::DBTable::run_end |
|
protected |
Last run in which this table is valid
◆ run_list
| std::vector<int> RAT::DBTable::run_list |
|
protected |
List of runs in which this table is valid
◆ table
JSON object storage of all fields, except callbacks
◆ tblname
| std::string RAT::DBTable::tblname |
|
protected |
◆ useRunList
| bool RAT::DBTable::useRunList = false |
|
protected |
Whether to use run list instead of range
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/db/include/RAT/DBTable.hh
- /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/db/src/DBTable.cc