ROOTANA
Public Member Functions | Static Public Member Functions | Data Fields
JsonOdb Class Reference

Access to ODB saved in JSON format inside midas .mid files. More...

Inheritance diagram for JsonOdb:
Inheritance graph
[legend]
Collaboration diagram for JsonOdb:
Collaboration graph
[legend]

Public Member Functions

 JsonOdb (MJsonNode *root, MJsonNode *dir, MVOdbError *error)
 
 ~JsonOdb ()
 
void SetPrintError (bool v)
 
bool GetPrintError () const
 
void SetNotFound (MVOdbError *error, const char *varname)
 
void SetVarError (MVOdbError *error, const char *varname, std::string msg)
 
void SetWrongType (MVOdbError *error, const char *varname, const MJsonNode *node, const char *wanted_type)
 
bool IsReadOnly () const
 
template<typename T >
bool GetJsonValue (const char *varname, const MJsonNode *node, T *value, MVOdbError *error)
 
MVOdbChdir (const char *subdir, bool create, MVOdbError *error)
 
void ReadKey (const char *varname, int *tid, int *num_values, int *total_size, int *item_size, MVOdbError *error)
 
void ReadKeyLastWritten (const char *varname, int *last_written, MVOdbError *error)
 
void ReadDir (std::vector< std::string > *varname, std::vector< int > *tid, std::vector< int > *num_values, std::vector< int > *total_size, std::vector< int > *item_size, MVOdbError *error)
 
void RB (const char *varname, bool *value, bool create, MVOdbError *error)
 
void RI (const char *varname, int *value, bool create, MVOdbError *error)
 
void RD (const char *varname, double *value, bool create, MVOdbError *error)
 
void RF (const char *varname, float *value, bool create, MVOdbError *error)
 
void RS (const char *varname, std::string *value, bool create, int create_string_length, MVOdbError *error)
 
void RU16 (const char *varname, uint16_t *value, bool create, MVOdbError *error)
 
void RU32 (const char *varname, uint32_t *value, bool create, MVOdbError *error)
 
template<typename T >
void RXA (const char *varname, std::vector< T > *value, MVOdbError *error)
 
void RBA (const char *varname, std::vector< bool > *value, bool create, int create_size, MVOdbError *error)
 
void RIA (const char *varname, std::vector< int > *value, bool create, int create_size, MVOdbError *error)
 
void RDA (const char *varname, std::vector< double > *value, bool create, int create_size, MVOdbError *error)
 
void RFA (const char *varname, std::vector< float > *value, bool create, int create_size, MVOdbError *error)
 
void RSA (const char *varname, std::vector< std::string > *value, bool create, int create_size, int create_string_length, MVOdbError *error)
 
void RU16A (const char *varname, std::vector< uint16_t > *value, bool create, int create_size, MVOdbError *error)
 
void RU32A (const char *varname, std::vector< uint32_t > *value, bool create, int create_size, MVOdbError *error)
 
template<typename T >
void RXAI (const char *varname, int index, T *value, MVOdbError *error)
 
void RBAI (const char *varname, int index, bool *value, MVOdbError *error)
 
void RIAI (const char *varname, int index, int *value, MVOdbError *error)
 
void RDAI (const char *varname, int index, double *value, MVOdbError *error)
 
void RFAI (const char *varname, int index, float *value, MVOdbError *error)
 
void RSAI (const char *varname, int index, std::string *value, MVOdbError *error)
 
void RU16AI (const char *varname, int index, uint16_t *value, MVOdbError *error)
 
void RU32AI (const char *varname, int index, uint32_t *value, MVOdbError *error)
 
void WB (const char *varname, bool v, MVOdbError *error)
 
void WI (const char *varname, int v, MVOdbError *error)
 
void WD (const char *varname, double v, MVOdbError *error)
 
void WF (const char *varname, float v, MVOdbError *error)
 
void WS (const char *varname, const char *v, int string_length, MVOdbError *error)
 
void WU16 (const char *varname, uint16_t v, MVOdbError *error)
 
void WU32 (const char *varname, uint32_t v, MVOdbError *error)
 
void WBA (const char *varname, const std::vector< bool > &v, MVOdbError *error)
 
void WIA (const char *varname, const std::vector< int > &v, MVOdbError *error)
 
void WDA (const char *varname, const std::vector< double > &v, MVOdbError *error)
 
void WFA (const char *varname, const std::vector< float > &v, MVOdbError *error)
 
void WSA (const char *varname, const std::vector< std::string > &data, int odb_string_length, MVOdbError *error)
 
void WU16A (const char *varname, const std::vector< uint16_t > &v, MVOdbError *error)
 
void WU32A (const char *varname, const std::vector< uint32_t > &v, MVOdbError *error)
 
void WBAI (const char *varname, int index, bool v, MVOdbError *error)
 
void WIAI (const char *varname, int index, int v, MVOdbError *error)
 
void WDAI (const char *varname, int index, double v, MVOdbError *error)
 
void WFAI (const char *varname, int index, float v, MVOdbError *error)
 
void WSAI (const char *varname, int index, const char *v, MVOdbError *error)
 
void WU16AI (const char *varname, int index, uint16_t v, MVOdbError *error)
 
void WU32AI (const char *varname, int index, uint32_t v, MVOdbError *error)
 
void Delete (const char *odbname, MVOdbError *error)
 
template<>
bool GetJsonValue (const char *varname, const MJsonNode *node, int *value, MVOdbError *error)
 
template<>
bool GetJsonValue (const char *varname, const MJsonNode *node, double *value, MVOdbError *error)
 
template<>
bool GetJsonValue (const char *varname, const MJsonNode *node, float *value, MVOdbError *error)
 
template<>
bool GetJsonValue (const char *varname, const MJsonNode *node, bool *value, MVOdbError *error)
 
template<>
bool GetJsonValue (const char *varname, const MJsonNode *node, uint16_t *value, MVOdbError *error)
 
template<>
bool GetJsonValue (const char *varname, const MJsonNode *node, uint32_t *value, MVOdbError *error)
 
- Public Member Functions inherited from MVOdb
virtual ~MVOdb ()=0
 
virtual ~MVOdb ()=0
 

Static Public Member Functions

static MJsonNodeFindPath (MJsonNode *dir, const char *path)
 Follow the ODB path through the JSON tree. More...
 

Data Fields

MJsonNodefRoot
 
MJsonNodefDir
 
std::string fPath
 
bool fPrintError
 

Detailed Description

Access to ODB saved in JSON format inside midas .mid files.

Definition at line 28 of file mjsonodb.cxx.

Constructor & Destructor Documentation

◆ JsonOdb()

JsonOdb::JsonOdb ( MJsonNode root,
MJsonNode dir,
MVOdbError error 
)
inline

Definition at line 37 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~JsonOdb()

JsonOdb::~JsonOdb ( )
inline

Definition at line 46 of file mjsonodb.cxx.

Member Function Documentation

◆ Chdir()

MVOdb* JsonOdb::Chdir ( const char *  subdir,
bool  create,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 158 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ Delete()

void JsonOdb::Delete ( const char *  odbname,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 464 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ FindPath()

static MJsonNode* JsonOdb::FindPath ( MJsonNode dir,
const char *  path 
)
inlinestatic

Follow the ODB path through the JSON tree.

Definition at line 110 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetJsonValue() [1/7]

template<>
bool JsonOdb::GetJsonValue ( const char *  varname,
const MJsonNode node,
bool *  value,
MVOdbError error 
)

Definition at line 497 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ GetJsonValue() [2/7]

template<>
bool JsonOdb::GetJsonValue ( const char *  varname,
const MJsonNode node,
double *  value,
MVOdbError error 
)

Definition at line 477 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ GetJsonValue() [3/7]

template<>
bool JsonOdb::GetJsonValue ( const char *  varname,
const MJsonNode node,
float *  value,
MVOdbError error 
)

Definition at line 487 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ GetJsonValue() [4/7]

template<>
bool JsonOdb::GetJsonValue ( const char *  varname,
const MJsonNode node,
int *  value,
MVOdbError error 
)

Definition at line 468 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ GetJsonValue() [5/7]

template<typename T >
bool JsonOdb::GetJsonValue ( const char *  varname,
const MJsonNode node,
T *  value,
MVOdbError error 
)

◆ GetJsonValue() [6/7]

template<>
bool JsonOdb::GetJsonValue ( const char *  varname,
const MJsonNode node,
uint16_t *  value,
MVOdbError error 
)

Definition at line 508 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ GetJsonValue() [7/7]

template<>
bool JsonOdb::GetJsonValue ( const char *  varname,
const MJsonNode node,
uint32_t *  value,
MVOdbError error 
)

Definition at line 518 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ GetPrintError()

bool JsonOdb::GetPrintError ( ) const
inlinevirtual

Implements MVOdb.

Definition at line 61 of file mjsonodb.cxx.

◆ IsReadOnly()

bool JsonOdb::IsReadOnly ( ) const
inlinevirtual

Implements MVOdb.

Definition at line 101 of file mjsonodb.cxx.

◆ RB()

void JsonOdb::RB ( const char *  varname,
bool *  value,
bool  create,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 220 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RBA()

void JsonOdb::RBA ( const char *  varname,
std::vector< bool > *  value,
bool  create,
int  create_size,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 300 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RBAI()

void JsonOdb::RBAI ( const char *  varname,
int  index,
bool *  value,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 401 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RD()

void JsonOdb::RD ( const char *  varname,
double *  value,
bool  create,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 230 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RDA()

void JsonOdb::RDA ( const char *  varname,
std::vector< double > *  value,
bool  create,
int  create_size,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 310 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RDAI()

void JsonOdb::RDAI ( const char *  varname,
int  index,
double *  value,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 411 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadDir()

void JsonOdb::ReadDir ( std::vector< std::string > *  varname,
std::vector< int > *  tid,
std::vector< int > *  num_values,
std::vector< int > *  total_size,
std::vector< int > *  item_size,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 214 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ ReadKey()

void JsonOdb::ReadKey ( const char *  varname,
int *  tid,
int *  num_values,
int *  total_size,
int *  item_size,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 197 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ ReadKeyLastWritten()

void JsonOdb::ReadKeyLastWritten ( const char *  varname,
int *  last_written,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 207 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RF()

void JsonOdb::RF ( const char *  varname,
float *  value,
bool  create,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 235 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RFA()

void JsonOdb::RFA ( const char *  varname,
std::vector< float > *  value,
bool  create,
int  create_size,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 315 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RFAI()

void JsonOdb::RFAI ( const char *  varname,
int  index,
float *  value,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 416 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RI()

void JsonOdb::RI ( const char *  varname,
int *  value,
bool  create,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 225 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RIA()

void JsonOdb::RIA ( const char *  varname,
std::vector< int > *  value,
bool  create,
int  create_size,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 305 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RIAI()

void JsonOdb::RIAI ( const char *  varname,
int  index,
int *  value,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 406 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RS()

void JsonOdb::RS ( const char *  varname,
std::string *  value,
bool  create,
int  create_string_length,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 240 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RSA()

void JsonOdb::RSA ( const char *  varname,
std::vector< std::string > *  value,
bool  create,
int  create_size,
int  create_string_length,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 320 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RSAI()

void JsonOdb::RSAI ( const char *  varname,
int  index,
std::string *  value,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 421 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RU16()

void JsonOdb::RU16 ( const char *  varname,
uint16_t *  value,
bool  create,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 245 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RU16A()

void JsonOdb::RU16A ( const char *  varname,
std::vector< uint16_t > *  value,
bool  create,
int  create_size,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 325 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RU16AI()

void JsonOdb::RU16AI ( const char *  varname,
int  index,
uint16_t *  value,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 426 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RU32()

void JsonOdb::RU32 ( const char *  varname,
uint32_t *  value,
bool  create,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 250 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RU32A()

void JsonOdb::RU32A ( const char *  varname,
std::vector< uint32_t > *  value,
bool  create,
int  create_size,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 330 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ RU32AI()

void JsonOdb::RU32AI ( const char *  varname,
int  index,
uint32_t *  value,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 431 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RXA()

template<typename T >
void JsonOdb::RXA ( const char *  varname,
std::vector< T > *  value,
MVOdbError error 
)
inline

Definition at line 256 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RXAI()

template<typename T >
void JsonOdb::RXAI ( const char *  varname,
int  index,
T *  value,
MVOdbError error 
)
inline

Definition at line 336 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNotFound()

void JsonOdb::SetNotFound ( MVOdbError error,
const char *  varname 
)
inline

Definition at line 66 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPrintError()

void JsonOdb::SetPrintError ( bool  v)
inlinevirtual

Implements MVOdb.

Definition at line 56 of file mjsonodb.cxx.

◆ SetVarError()

void JsonOdb::SetVarError ( MVOdbError error,
const char *  varname,
std::string  msg 
)
inline

Definition at line 76 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetWrongType()

void JsonOdb::SetWrongType ( MVOdbError error,
const char *  varname,
const MJsonNode node,
const char *  wanted_type 
)
inline

Definition at line 85 of file mjsonodb.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WB()

void JsonOdb::WB ( const char *  varname,
bool  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 438 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WBA()

void JsonOdb::WBA ( const char *  varname,
const std::vector< bool > &  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 446 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WBAI()

void JsonOdb::WBAI ( const char *  varname,
int  index,
bool  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 454 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WD()

void JsonOdb::WD ( const char *  varname,
double  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 440 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WDA()

void JsonOdb::WDA ( const char *  varname,
const std::vector< double > &  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 448 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WDAI()

void JsonOdb::WDAI ( const char *  varname,
int  index,
double  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 456 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WF()

void JsonOdb::WF ( const char *  varname,
float  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 441 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WFA()

void JsonOdb::WFA ( const char *  varname,
const std::vector< float > &  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 449 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WFAI()

void JsonOdb::WFAI ( const char *  varname,
int  index,
float  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 457 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WI()

void JsonOdb::WI ( const char *  varname,
int  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 439 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WIA()

void JsonOdb::WIA ( const char *  varname,
const std::vector< int > &  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 447 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WIAI()

void JsonOdb::WIAI ( const char *  varname,
int  index,
int  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 455 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WS()

void JsonOdb::WS ( const char *  varname,
const char *  v,
int  string_length,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 442 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WSA()

void JsonOdb::WSA ( const char *  varname,
const std::vector< std::string > &  data,
int  odb_string_length,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 450 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WSAI()

void JsonOdb::WSAI ( const char *  varname,
int  index,
const char *  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 458 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WU16()

void JsonOdb::WU16 ( const char *  varname,
uint16_t  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 443 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WU16A()

void JsonOdb::WU16A ( const char *  varname,
const std::vector< uint16_t > &  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 451 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WU16AI()

void JsonOdb::WU16AI ( const char *  varname,
int  index,
uint16_t  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 459 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WU32()

void JsonOdb::WU32 ( const char *  varname,
uint32_t  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 444 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WU32A()

void JsonOdb::WU32A ( const char *  varname,
const std::vector< uint32_t > &  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 452 of file mjsonodb.cxx.

Here is the call graph for this function:

◆ WU32AI()

void JsonOdb::WU32AI ( const char *  varname,
int  index,
uint32_t  v,
MVOdbError error 
)
inlinevirtual

Implements MVOdb.

Definition at line 460 of file mjsonodb.cxx.

Here is the call graph for this function:

Field Documentation

◆ fDir

MJsonNode* JsonOdb::fDir

Definition at line 32 of file mjsonodb.cxx.

◆ fPath

std::string JsonOdb::fPath

Definition at line 33 of file mjsonodb.cxx.

◆ fPrintError

bool JsonOdb::fPrintError

Definition at line 34 of file mjsonodb.cxx.

◆ fRoot

MJsonNode* JsonOdb::fRoot

Definition at line 31 of file mjsonodb.cxx.


The documentation for this class was generated from the following file: