DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
dabc::RecordField Class Reference

#include <dabc/Record.h>

Public Member Functions

bool AsBool (bool dflt=false) const
 
dabc::Buffer AsBuffer () const
 
double AsDouble (double dflt=0.) const
 
std::vector< double > AsDoubleVect () const
 
int64_t AsInt (int64_t dflt=0) const
 
std::vector< int64_t > AsIntVect () const
 
std::string AsJson () const
 Returns field value in JSON format. More...
 
dabc::Reference AsReference () const
 
std::string AsStr (const std::string &dflt="") const
 
std::vector< std::string > AsStrVect () const
 
uint64_t AsUInt (uint64_t dflt=0) const
 
std::vector< uint64_t > AsUIntVect () const
 
int64_t GetArraySize () const
 
double * GetDoubleArr () const
 
int64_t * GetIntArr () const
 
uint64_t * GetUIntArr () const
 
bool IsArray () const
 
bool IsModified () const
 
bool IsProtected () const
 
bool null () const
 
RecordFieldoperator= (const RecordField &src)
 
 RecordField ()
 
 RecordField (const bool &v)
 
 RecordField (const Buffer &buf)
 
 RecordField (const char *v)
 
 RecordField (const DateTime &v)
 
 RecordField (const double &v)
 
 RecordField (const int &v)
 
 RecordField (const int64_t &v)
 
 RecordField (const RecordField &src)
 
 RecordField (const Reference &ref)
 
 RecordField (const std::string &v)
 
 RecordField (const std::vector< double > &v)
 
 RecordField (const std::vector< int64_t > &v)
 
 RecordField (const std::vector< std::string > &v)
 
 RecordField (const std::vector< uint64_t > &v)
 
 RecordField (const uint64_t &v)
 
 RecordField (const unsigned &v)
 
bool SetArrDouble (int64_t size, double *arr, bool owner=false)
 Set as array, if owner flag specified, one get ownership over array and do not need to create copy. More...
 
bool SetArrInt (int64_t size, int64_t *arr, bool owner=false)
 Set as array, if owner flag specified, one get ownership over array and do not need to create copy. More...
 
bool SetArrStr (int64_t size, char *arr, bool owner=false)
 Sets as array of string, placed one after another in memory. More...
 
bool SetArrUInt (int64_t size, uint64_t *arr, bool owner=false)
 Set as array, if owner flag specified, one get ownership over array and do not need to create copy. More...
 
bool SetBool (bool v)
 
bool SetBuffer (const Buffer &buf)
 
bool SetDatime (const DateTime &v)
 
bool SetDatime (uint64_t v)
 
bool SetDouble (double v)
 
bool SetInt (int64_t v)
 
void SetModified (bool on=true)
 
bool SetNull ()
 
void SetProtected (bool on=true)
 
bool SetReference (const Reference &ref)
 
bool SetStr (const char *v)
 
bool SetStr (const std::string &v)
 
bool SetStrVect (const std::vector< std::string > &vect)
 
bool SetUInt (uint64_t v)
 
bool SetValue (const RecordField &src)
 
bool SetVectDouble (const std::vector< double > &v)
 
bool SetVectInt (const std::vector< int64_t > &v)
 
bool SetVectUInt (const std::vector< uint64_t > &v)
 
uint64_t StoreSize ()
 
bool Stream (iostream &s)
 
virtual ~RecordField ()
 

Static Public Member Functions

static std::string JsonReformat (const std::string &str)
 
static bool NeedJsonReformat (const std::string &str)
 
static bool StrToStrVect (const char *str, std::vector< std::string > &vect, bool verbose=true)
 

Protected Types

enum  ValueKind {
  kind_none = 0 , kind_bool = 1 , kind_int = 2 , kind_datime = 3 ,
  kind_uint = 4 , kind_double = 5 , kind_arrint = 6 , kind_arruint = 7 ,
  kind_arrdouble = 8 , kind_string = 9 , kind_arrstr = 10 , kind_buffer = 11 ,
  kind_reference = 12
}
 

Protected Member Functions

bool cannot_modify ()
 
void constructor ()
 
bool isreadonly () const
 
bool modified (bool reallychanged=true)
 
void release ()
 ! when true, field will not be automatically deleted when full list updated from other hierarchy More...
 
void SetArrStrDirect (int64_t size, char *arr, bool owner=false)
 

Protected Attributes

union {
   double   valueDouble
 scalar unsigned int type More...
 
   int64_t   valueInt
 
   uint64_t   valueUInt
 scalar int type More...
 
}; 
 
union {
   double *   arrDouble
 ! uint array, size in valueInt More...
 
   int64_t *   arrInt
 
   uint64_t *   arrUInt
 ! int array, size in valueInt More...
 
   Buffer *   valueBuf
 ! string or array of strings More...
 
   Reference *   valueRef
 ! buffer object More...
 
   char *   valueStr
 ! double array, size in valueInt More...
 
}; 
 
ValueKind fKind
 
bool fModified
 
bool fProtected
 ! flag, used to detect in streamer when field was touched at all More...
 
bool fTouched
 ! when true, field was modified at least once More...
 

Friends

class RecordFieldsMap
 

Detailed Description

Definition at line 223 of file Record.h.

Member Enumeration Documentation

◆ ValueKind

Enumerator
kind_none 
kind_bool 
kind_int 
kind_datime 
kind_uint 
kind_double 
kind_arrint 
kind_arruint 
kind_arrdouble 
kind_string 
kind_arrstr 
kind_buffer 
kind_reference 

Definition at line 227 of file Record.h.

Constructor & Destructor Documentation

◆ RecordField() [1/17]

dabc::RecordField::RecordField ( )

Definition at line 293 of file Record.cxx.

◆ RecordField() [2/17]

dabc::RecordField::RecordField ( const RecordField src)

Definition at line 308 of file Record.cxx.

◆ RecordField() [3/17]

dabc::RecordField::RecordField ( const char *  v)
inline

Definition at line 282 of file Record.h.

◆ RecordField() [4/17]

dabc::RecordField::RecordField ( const std::string &  v)
inline

Definition at line 283 of file Record.h.

◆ RecordField() [5/17]

dabc::RecordField::RecordField ( const int &  v)
inline

Definition at line 284 of file Record.h.

◆ RecordField() [6/17]

dabc::RecordField::RecordField ( const int64_t &  v)
inline

Definition at line 285 of file Record.h.

◆ RecordField() [7/17]

dabc::RecordField::RecordField ( const unsigned &  v)
inline

Definition at line 286 of file Record.h.

◆ RecordField() [8/17]

dabc::RecordField::RecordField ( const uint64_t &  v)
inline

Definition at line 287 of file Record.h.

◆ RecordField() [9/17]

dabc::RecordField::RecordField ( const double &  v)
inline

Definition at line 288 of file Record.h.

◆ RecordField() [10/17]

dabc::RecordField::RecordField ( const bool &  v)
inline

Definition at line 289 of file Record.h.

◆ RecordField() [11/17]

dabc::RecordField::RecordField ( const DateTime v)
inline

Definition at line 290 of file Record.h.

◆ RecordField() [12/17]

dabc::RecordField::RecordField ( const std::vector< int64_t > &  v)
inline

Definition at line 291 of file Record.h.

◆ RecordField() [13/17]

dabc::RecordField::RecordField ( const std::vector< uint64_t > &  v)
inline

Definition at line 292 of file Record.h.

◆ RecordField() [14/17]

dabc::RecordField::RecordField ( const std::vector< double > &  v)
inline

Definition at line 293 of file Record.h.

◆ RecordField() [15/17]

dabc::RecordField::RecordField ( const std::vector< std::string > &  v)
inline

Definition at line 294 of file Record.h.

◆ RecordField() [16/17]

dabc::RecordField::RecordField ( const Buffer buf)
inline

Definition at line 295 of file Record.h.

◆ RecordField() [17/17]

dabc::RecordField::RecordField ( const Reference ref)
inline

Definition at line 296 of file Record.h.

◆ ~RecordField()

dabc::RecordField::~RecordField ( )
virtual

Definition at line 331 of file Record.cxx.

Member Function Documentation

◆ release()

void dabc::RecordField::release ( )
protected

! when true, field will not be automatically deleted when full list updated from other hierarchy

Definition at line 456 of file Record.cxx.

◆ modified()

bool dabc::RecordField::modified ( bool  reallychanged = true)
inlineprotected

Definition at line 266 of file Record.h.

◆ isreadonly()

bool dabc::RecordField::isreadonly ( ) const
inlineprotected

Definition at line 272 of file Record.h.

◆ cannot_modify()

bool dabc::RecordField::cannot_modify ( )
protected

Definition at line 302 of file Record.cxx.

◆ SetArrStrDirect()

void dabc::RecordField::SetArrStrDirect ( int64_t  size,
char *  arr,
bool  owner = false 
)
protected

Definition at line 1347 of file Record.cxx.

◆ constructor()

void dabc::RecordField::constructor ( )
inlineprotected

Definition at line 277 of file Record.h.

◆ operator=()

RecordField& dabc::RecordField::operator= ( const RecordField src)
inline

Definition at line 298 of file Record.h.

◆ null()

bool dabc::RecordField::null ( ) const
inline

Definition at line 302 of file Record.h.

◆ IsModified()

bool dabc::RecordField::IsModified ( ) const
inline

Definition at line 304 of file Record.h.

◆ SetModified()

void dabc::RecordField::SetModified ( bool  on = true)
inline

Definition at line 305 of file Record.h.

◆ IsProtected()

bool dabc::RecordField::IsProtected ( ) const
inline

Definition at line 307 of file Record.h.

◆ SetProtected()

void dabc::RecordField::SetProtected ( bool  on = true)
inline

Definition at line 308 of file Record.h.

◆ IsArray()

bool dabc::RecordField::IsArray ( ) const
inline

Definition at line 310 of file Record.h.

◆ GetArraySize()

int64_t dabc::RecordField::GetArraySize ( ) const
inline

Definition at line 317 of file Record.h.

◆ AsBool()

bool dabc::RecordField::AsBool ( bool  dflt = false) const

Definition at line 477 of file Record.cxx.

◆ AsInt()

int64_t dabc::RecordField::AsInt ( int64_t  dflt = 0) const

Definition at line 501 of file Record.cxx.

◆ AsUInt()

uint64_t dabc::RecordField::AsUInt ( uint64_t  dflt = 0) const

Definition at line 525 of file Record.cxx.

◆ AsDouble()

double dabc::RecordField::AsDouble ( double  dflt = 0.) const

Definition at line 549 of file Record.cxx.

◆ AsStr()

std::string dabc::RecordField::AsStr ( const std::string &  dflt = "") const

Definition at line 749 of file Record.cxx.

◆ AsIntVect()

std::vector< int64_t > dabc::RecordField::AsIntVect ( ) const

Definition at line 573 of file Record.cxx.

◆ GetIntArr()

int64_t* dabc::RecordField::GetIntArr ( ) const
inline

Definition at line 325 of file Record.h.

◆ AsUIntVect()

std::vector< uint64_t > dabc::RecordField::AsUIntVect ( ) const

Definition at line 631 of file Record.cxx.

◆ GetUIntArr()

uint64_t* dabc::RecordField::GetUIntArr ( ) const
inline

Definition at line 327 of file Record.h.

◆ AsDoubleVect()

std::vector< double > dabc::RecordField::AsDoubleVect ( ) const

Definition at line 691 of file Record.cxx.

◆ GetDoubleArr()

double* dabc::RecordField::GetDoubleArr ( ) const
inline

Definition at line 329 of file Record.h.

◆ AsStrVect()

std::vector< std::string > dabc::RecordField::AsStrVect ( ) const

Definition at line 923 of file Record.cxx.

◆ AsBuffer()

dabc::Buffer dabc::RecordField::AsBuffer ( ) const

Definition at line 969 of file Record.cxx.

◆ AsReference()

dabc::Reference dabc::RecordField::AsReference ( ) const

Definition at line 976 of file Record.cxx.

◆ AsJson()

std::string dabc::RecordField::AsJson ( ) const

Returns field value in JSON format.

Definition at line 835 of file Record.cxx.

◆ SetValue()

bool dabc::RecordField::SetValue ( const RecordField src)

Definition at line 1030 of file Record.cxx.

◆ SetNull()

bool dabc::RecordField::SetNull ( )

Definition at line 1051 of file Record.cxx.

◆ SetBool()

bool dabc::RecordField::SetBool ( bool  v)

Definition at line 1060 of file Record.cxx.

◆ SetInt()

bool dabc::RecordField::SetInt ( int64_t  v)

Definition at line 1073 of file Record.cxx.

◆ SetDatime() [1/2]

bool dabc::RecordField::SetDatime ( uint64_t  v)

Definition at line 1083 of file Record.cxx.

◆ SetDatime() [2/2]

bool dabc::RecordField::SetDatime ( const DateTime v)

Definition at line 1095 of file Record.cxx.

◆ SetUInt()

bool dabc::RecordField::SetUInt ( uint64_t  v)

Definition at line 1101 of file Record.cxx.

◆ SetDouble()

bool dabc::RecordField::SetDouble ( double  v)

Definition at line 1114 of file Record.cxx.

◆ SetStr() [1/2]

bool dabc::RecordField::SetStr ( const std::string &  v)

Definition at line 1127 of file Record.cxx.

◆ SetStr() [2/2]

bool dabc::RecordField::SetStr ( const char *  v)

Definition at line 1144 of file Record.cxx.

◆ SetStrVect()

bool dabc::RecordField::SetStrVect ( const std::vector< std::string > &  vect)

Definition at line 1162 of file Record.cxx.

◆ SetBuffer()

bool dabc::RecordField::SetBuffer ( const Buffer buf)

Definition at line 1197 of file Record.cxx.

◆ SetReference()

bool dabc::RecordField::SetReference ( const Reference ref)

Definition at line 1210 of file Record.cxx.

◆ SetArrInt()

bool dabc::RecordField::SetArrInt ( int64_t  size,
int64_t *  arr,
bool  owner = false 
)

Set as array, if owner flag specified, one get ownership over array and do not need to create copy.

Definition at line 1224 of file Record.cxx.

◆ SetVectInt()

bool dabc::RecordField::SetVectInt ( const std::vector< int64_t > &  v)

Definition at line 1251 of file Record.cxx.

◆ SetArrUInt()

bool dabc::RecordField::SetArrUInt ( int64_t  size,
uint64_t *  arr,
bool  owner = false 
)

Set as array, if owner flag specified, one get ownership over array and do not need to create copy.

Definition at line 1263 of file Record.cxx.

◆ SetVectUInt()

bool dabc::RecordField::SetVectUInt ( const std::vector< uint64_t > &  v)

Definition at line 1287 of file Record.cxx.

◆ SetArrDouble()

bool dabc::RecordField::SetArrDouble ( int64_t  size,
double *  arr,
bool  owner = false 
)

Set as array, if owner flag specified, one get ownership over array and do not need to create copy.

Definition at line 1312 of file Record.cxx.

◆ SetVectDouble()

bool dabc::RecordField::SetVectDouble ( const std::vector< double > &  v)

Definition at line 1299 of file Record.cxx.

◆ SetArrStr()

bool dabc::RecordField::SetArrStr ( int64_t  size,
char *  arr,
bool  owner = false 
)

Sets as array of string, placed one after another in memory.

Definition at line 1336 of file Record.cxx.

◆ StoreSize()

uint64_t dabc::RecordField::StoreSize ( )
Returns
Total size, which is required to stream object

Definition at line 336 of file Record.cxx.

◆ Stream()

bool dabc::RecordField::Stream ( iostream s)

Definition at line 343 of file Record.cxx.

◆ NeedJsonReformat()

bool dabc::RecordField::NeedJsonReformat ( const std::string &  str)
static

Definition at line 792 of file Record.cxx.

◆ JsonReformat()

std::string dabc::RecordField::JsonReformat ( const std::string &  str)
static

Definition at line 813 of file Record.cxx.

◆ StrToStrVect()

bool dabc::RecordField::StrToStrVect ( const char *  str,
std::vector< std::string > &  vect,
bool  verbose = true 
)
static

Definition at line 983 of file Record.cxx.

Friends And Related Function Documentation

◆ RecordFieldsMap

friend class RecordFieldsMap
friend

Definition at line 224 of file Record.h.

Field Documentation

◆ fKind

ValueKind dabc::RecordField::fKind
protected

Definition at line 243 of file Record.h.

◆ valueInt

int64_t dabc::RecordField::valueInt

Definition at line 246 of file Record.h.

◆ valueUInt

uint64_t dabc::RecordField::valueUInt

scalar int type

Definition at line 247 of file Record.h.

◆ valueDouble

double dabc::RecordField::valueDouble

scalar unsigned int type

Definition at line 248 of file Record.h.

◆ 

union { ... }

◆ arrInt

int64_t* dabc::RecordField::arrInt

Definition at line 252 of file Record.h.

◆ arrUInt

uint64_t* dabc::RecordField::arrUInt

! int array, size in valueInt

Definition at line 253 of file Record.h.

◆ arrDouble

double* dabc::RecordField::arrDouble

! uint array, size in valueInt

Definition at line 254 of file Record.h.

◆ valueStr

char* dabc::RecordField::valueStr

! double array, size in valueInt

Definition at line 255 of file Record.h.

◆ valueBuf

Buffer* dabc::RecordField::valueBuf

! string or array of strings

Definition at line 256 of file Record.h.

◆ valueRef

Reference* dabc::RecordField::valueRef

! buffer object

Definition at line 257 of file Record.h.

◆ 

union { ... }

◆ fModified

bool dabc::RecordField::fModified
protected

Definition at line 260 of file Record.h.

◆ fTouched

bool dabc::RecordField::fTouched
protected

! when true, field was modified at least once

Definition at line 261 of file Record.h.

◆ fProtected

bool dabc::RecordField::fProtected
protected

! flag, used to detect in streamer when field was touched at all

Definition at line 262 of file Record.h.


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