DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::oks::OksData Struct Reference

Struct OKS data. More...

#include <object.hpp>

Collaboration diagram for dunedaq::oks::OksData:
[legend]

Classes

union  Data

Public Types

enum  Type {
  unknown_type = 0 , s8_int_type = 1 , u8_int_type = 2 , s16_int_type = 3 ,
  u16_int_type = 4 , s32_int_type = 5 , u32_int_type = 6 , s64_int_type = 7 ,
  u64_int_type = 8 , float_type = 9 , double_type = 10 , bool_type = 11 ,
  class_type = 12 , object_type = 13 , date_type = 14 , time_type = 15 ,
  string_type = 16 , list_type = 17 , uid_type = 18 , uid2_type = 19 ,
  enum_type = 20
}
typedef std::list< OksData *, boost::fast_pool_allocator< OksData * > > List

Public Member Functions

 OksData ()
 OksData (int8_t c)
 OksData (uint8_t c)
 OksData (int16_t i)
 OksData (uint16_t i)
 OksData (int32_t i)
 OksData (uint32_t i)
 OksData (int64_t i)
 OksData (uint64_t i)
 OksData (const float &f)
 OksData (const double &d)
 OksData (bool b)
 OksData (boost::gregorian::date d)
 OksData (boost::posix_time::ptime t)
 OksData (OksString *s)
 OksData (const char *s)
 OksData (const std::string &s)
 OksData (const OksString &s)
 OksData (const char *s, size_t len, const OksAttribute *a)
 OksData (const std::string &s, const OksAttribute *a)
 OksData (const OksString &s, const OksAttribute *a)
 OksData (const OksClass *c)
 OksData (List *l)
 OksData (OksObject *o)
 OksData (const OksClass *c, const char *o)
 OksData (const OksClass *c, const OksString &o)
 OksData (const std::string &c, const std::string &o)
 ~OksData ()
void Clear ()
void Clear2 ()
void Set (int8_t c)
void Set (uint8_t c)
void Set (int16_t i)
void Set (uint16_t i)
void Set (int32_t i)
void Set (uint32_t i)
void Set (int64_t i)
void Set (uint64_t i)
void Set (const float &f)
void Set (const double &d)
void Set (bool b)
void SetFast (boost::gregorian::date d)
void SetFast (boost::posix_time::ptime t)
void Set (boost::gregorian::date d)
void Set (boost::posix_time::ptime t)
void Set (OksString *s)
void Set (const char *s)
void Set (const std::string &s)
void Set (const OksString &s)
void Set (const OksClass *c)
void SetE (OksString *s, const OksAttribute *a)
void SetE (const char *s, size_t len, const OksAttribute *a)
void SetE (const std::string &s, const OksAttribute *a)
void SetE (const OksAttribute *a)
void SetE (const OksString &s, const OksAttribute *a)
void Set (List *l)
void Set (OksObject *o)
void Set (const OksClass *c, const OksString &s)
void Set (const OksClass *c, OksString *s)
void Set (const OksString &c, const OksString &s)
void Set (OksString *c, OksString *s)
void ReadFrom (const char *, Type, const OksAttribute *)
void ReadFrom (const std::string &, const OksAttribute *)
void SetNullValue (const OksAttribute *a)
void SetValue (const char *s, const OksAttribute *a)
void SetValues (const char *, const OksAttribute *a)
void ReadFrom (const OksRelationship *) noexcept
void WriteTo (OksXmlOutputStream &, bool) const
void WriteTo (OksXmlOutputStream &) const
void ConvertTo (OksData *, const OksRelationship *) const
boost::gregorian::date date () const noexcept
boost::posix_time::ptime time () const noexcept
void cvt (OksData *to, const OksAttribute *attr) const
 Convert data to new type.
std::string str (int base=0) const
std::string str (const OksKernel *) const
void check_range (const OksAttribute *a) const
 Check range of data.
void set_init_value (const OksAttribute *attr, bool skip_init)
 Set value defined by initial value of attribute.
OksData & operator= (const OksData &d)
 OksData (const OksData &d)
bool operator== (const OksData &) const
bool operator!= (const OksData &) const
bool operator<= (const OksData &) const
bool operator>= (const OksData &) const
bool operator< (const OksData &) const
bool operator> (const OksData &) const
void * operator new (size_t)
void operator delete (void *ptr)
void sort (bool ascending=true)

Static Public Member Functions

static bool is_object (Type t)

Public Attributes

enum dunedaq::oks::OksData::Type type
union dunedaq::oks::OksData::Data data

Private Member Functions

void copy (const OksData &)
bool is_le (const OksData &) const noexcept
bool is_ge (const OksData &) const noexcept
bool is_l (const OksData &) const noexcept
bool is_g (const OksData &) const noexcept
void read (const oks::ReadFileParams &, const OksAttribute *, int32_t)
 private methods which can be used by OksObject class only
void read (const oks::ReadFileParams &, const OksAttribute *)
void read (const OksAttribute *, const OksXmlValue &)
void read (const OksAttribute *, const oks::ReadFileParams &)
void read (const oks::ReadFileParams &, const OksRelationship *, int32_t)
void read (const oks::ReadFileParams &, const OksRelationship *)
void read (const OksRelationship *, const OksXmlRelValue &)
void read (const OksRelationship *, const oks::ReadFileParams &)
 OksData (const oks::ReadFileParams &params, const OksAttribute *a, int32_t n)
 OksData (const oks::ReadFileParams &params, const OksAttribute *a)
 OksData (const OksAttribute *a, const OksXmlValue &value)
 OksData (const OksAttribute *a, const oks::ReadFileParams &params)
 OksData (const oks::ReadFileParams &params, const OksRelationship *r, int32_t n)
 OksData (const oks::ReadFileParams &params, const OksRelationship *r)
 OksData (const OksRelationship *r, const OksXmlRelValue &value)
 OksData (const OksRelationship *r, const oks::ReadFileParams &params)
void WriteTo (OksXmlOutputStream &, OksKernel *, OksAliasTable *, bool, bool) const
bool IsConsistent (const OksRelationship *r, const OksObject *o, const char *msg)
const std::string & __oid () const
const std::string & __cn () const

Friends

class OksObject
class OksKernel
std::ostream & operator<< (std::ostream &, const OksData &)

Detailed Description

Struct OKS data.

the structure to pass common parameters to various read() methods of OksData and OksObject class

The struct OksData is used to present OKS data types (the type is unknown before run-time) Members: enumeration 'type' is used to define data type in run-time union 'data' is used to represent such type

Definition at line 509 of file object.hpp.

Member Typedef Documentation

◆ List

typedef std::list<OksData*, boost::fast_pool_allocator<OksData*> > dunedaq::oks::OksData::List

Definition at line 515 of file object.hpp.

Member Enumeration Documentation

◆ Type

Enumerator
unknown_type 
s8_int_type 
u8_int_type 
s16_int_type 
u16_int_type 
s32_int_type 
u32_int_type 
s64_int_type 
u64_int_type 
float_type 
double_type 
bool_type 
class_type 
object_type 
date_type 
time_type 
string_type 
list_type 
uid_type 
uid2_type 
enum_type 

Definition at line 517 of file object.hpp.

518 {
519 unknown_type = 0,
520 s8_int_type = 1,
521 u8_int_type = 2,
522 s16_int_type = 3,
523 u16_int_type = 4,
524 s32_int_type = 5,
525 u32_int_type = 6,
526 s64_int_type = 7,
527 u64_int_type = 8,
528 float_type = 9,
529 double_type = 10,
530 bool_type = 11,
531 class_type = 12,
532 object_type = 13,
533 date_type = 14,
534 time_type = 15,
535 string_type = 16,
536 list_type = 17,
537 uid_type = 18,
538 uid2_type = 19,
539 enum_type = 20
540 } type;
enum dunedaq::oks::OksData::Type type

Constructor & Destructor Documentation

◆ OksData() [1/36]

dunedaq::oks::OksData::OksData ( )
inline

Definition at line 574 of file object.hpp.

574{ Clear2(); }

◆ OksData() [2/36]

dunedaq::oks::OksData::OksData ( int8_t c)
inline

Definition at line 575 of file object.hpp.

576 {
577 Clear2();
578 Set(c);
579 }
void Set(int8_t c)
Definition object.hpp:711

◆ OksData() [3/36]

dunedaq::oks::OksData::OksData ( uint8_t c)
inline

Definition at line 580 of file object.hpp.

581 {
582 Clear2();
583 Set(c);
584 }

◆ OksData() [4/36]

dunedaq::oks::OksData::OksData ( int16_t i)
inline

Definition at line 585 of file object.hpp.

586 {
587 Clear2();
588 Set(i);
589 }

◆ OksData() [5/36]

dunedaq::oks::OksData::OksData ( uint16_t i)
inline

Definition at line 590 of file object.hpp.

591 {
592 Clear2();
593 Set(i);
594 }

◆ OksData() [6/36]

dunedaq::oks::OksData::OksData ( int32_t i)
inline

Definition at line 595 of file object.hpp.

596 {
597 Clear2();
598 Set(i);
599 }

◆ OksData() [7/36]

dunedaq::oks::OksData::OksData ( uint32_t i)
inline

Definition at line 600 of file object.hpp.

601 {
602 Clear2();
603 Set(i);
604 }

◆ OksData() [8/36]

dunedaq::oks::OksData::OksData ( int64_t i)
inline

Definition at line 605 of file object.hpp.

606 {
607 Clear2();
608 Set(i);
609 }

◆ OksData() [9/36]

dunedaq::oks::OksData::OksData ( uint64_t i)
inline

Definition at line 610 of file object.hpp.

611 {
612 Clear2();
613 Set(i);
614 }

◆ OksData() [10/36]

dunedaq::oks::OksData::OksData ( const float & f)
inline

Definition at line 615 of file object.hpp.

616 {
617 Clear2();
618 Set(f);
619 }

◆ OksData() [11/36]

dunedaq::oks::OksData::OksData ( const double & d)
inline

Definition at line 620 of file object.hpp.

621 {
622 Clear2();
623 Set(d);
624 }

◆ OksData() [12/36]

dunedaq::oks::OksData::OksData ( bool b)
inline

Definition at line 625 of file object.hpp.

626 {
627 Clear2();
628 Set(b);
629 }

◆ OksData() [13/36]

dunedaq::oks::OksData::OksData ( boost::gregorian::date d)
inline

Definition at line 630 of file object.hpp.

631 {
632 Clear2();
633 Set(d);
634 }

◆ OksData() [14/36]

dunedaq::oks::OksData::OksData ( boost::posix_time::ptime t)
inline

Definition at line 635 of file object.hpp.

636 {
637 Clear2();
638 Set(t);
639 }

◆ OksData() [15/36]

dunedaq::oks::OksData::OksData ( OksString * s)
inline

Definition at line 640 of file object.hpp.

641 {
642 Clear2();
643 Set(s);
644 }

◆ OksData() [16/36]

dunedaq::oks::OksData::OksData ( const char * s)
inline

Definition at line 645 of file object.hpp.

646 {
647 Clear2();
648 Set(s);
649 }

◆ OksData() [17/36]

dunedaq::oks::OksData::OksData ( const std::string & s)
inline

Definition at line 650 of file object.hpp.

651 {
652 Clear2();
653 Set(s);
654 }

◆ OksData() [18/36]

dunedaq::oks::OksData::OksData ( const OksString & s)
inline

Definition at line 655 of file object.hpp.

656 {
657 Clear2();
658 Set(s);
659 }

◆ OksData() [19/36]

dunedaq::oks::OksData::OksData ( const char * s,
size_t len,
const OksAttribute * a )
inline

Definition at line 660 of file object.hpp.

661 {
662 Clear2();
663 SetE(s, len, a);
664 }
void SetE(OksString *s, const OksAttribute *a)

◆ OksData() [20/36]

dunedaq::oks::OksData::OksData ( const std::string & s,
const OksAttribute * a )
inline

Definition at line 665 of file object.hpp.

666 {
667 Clear2();
668 SetE(s, a);
669 }

◆ OksData() [21/36]

dunedaq::oks::OksData::OksData ( const OksString & s,
const OksAttribute * a )
inline

Definition at line 670 of file object.hpp.

671 {
672 Clear2();
673 SetE(s, a);
674 }

◆ OksData() [22/36]

dunedaq::oks::OksData::OksData ( const OksClass * c)
inline

Definition at line 675 of file object.hpp.

676 {
677 Clear2();
678 Set(c);
679 }

◆ OksData() [23/36]

dunedaq::oks::OksData::OksData ( List * l)
inline

Definition at line 680 of file object.hpp.

681 {
682 Clear2();
683 Set(l);
684 }

◆ OksData() [24/36]

dunedaq::oks::OksData::OksData ( OksObject * o)
inline

Definition at line 685 of file object.hpp.

686 {
687 Clear2();
688 Set(o);
689 }

◆ OksData() [25/36]

dunedaq::oks::OksData::OksData ( const OksClass * c,
const char * o )
inline

Definition at line 690 of file object.hpp.

691 {
692 Clear();
693 Set(c, o);
694 }

◆ OksData() [26/36]

dunedaq::oks::OksData::OksData ( const OksClass * c,
const OksString & o )
inline

Definition at line 695 of file object.hpp.

696 {
697 Clear();
698 Set(c, o);
699 }

◆ OksData() [27/36]

dunedaq::oks::OksData::OksData ( const std::string & c,
const std::string & o )
inline

Definition at line 700 of file object.hpp.

701 {
702 Clear2();
703 Set(c, o);
704 }

◆ ~OksData()

dunedaq::oks::OksData::~OksData ( )
inline

Definition at line 706 of file object.hpp.

706{ Clear(); }

◆ OksData() [28/36]

dunedaq::oks::OksData::OksData ( const OksData & d)
inline

Definition at line 971 of file object.hpp.

972 {
973 if (&d != this) {
974 copy(d);
975 }
976 }
void copy(const OksData &)

◆ OksData() [29/36]

dunedaq::oks::OksData::OksData ( const oks::ReadFileParams & params,
const OksAttribute * a,
int32_t n )
inlineprivate

Definition at line 1012 of file object.hpp.

1013 {
1014 Clear2();
1015 read(params, a, n);
1016 }
void read(const oks::ReadFileParams &, const OksAttribute *, int32_t)
private methods which can be used by OksObject class only

◆ OksData() [30/36]

dunedaq::oks::OksData::OksData ( const oks::ReadFileParams & params,
const OksAttribute * a )
inlineprivate

Definition at line 1017 of file object.hpp.

1018 {
1019 Clear2();
1020 read(params, a);
1021 }

◆ OksData() [31/36]

dunedaq::oks::OksData::OksData ( const OksAttribute * a,
const OksXmlValue & value )
inlineprivate

Definition at line 1022 of file object.hpp.

1023 {
1024 Clear2();
1025 read(a, value);
1026 }

◆ OksData() [32/36]

dunedaq::oks::OksData::OksData ( const OksAttribute * a,
const oks::ReadFileParams & params )
inlineprivate

Definition at line 1027 of file object.hpp.

1028 {
1029 Clear2();
1030 read(a, params);
1031 }

◆ OksData() [33/36]

dunedaq::oks::OksData::OksData ( const oks::ReadFileParams & params,
const OksRelationship * r,
int32_t n )
inlineprivate

Definition at line 1033 of file object.hpp.

1034 {
1035 Clear2();
1036 read(params, r, n);
1037 }

◆ OksData() [34/36]

dunedaq::oks::OksData::OksData ( const oks::ReadFileParams & params,
const OksRelationship * r )
inlineprivate

Definition at line 1038 of file object.hpp.

1039 {
1040 Clear2();
1041 read(params, r);
1042 }

◆ OksData() [35/36]

dunedaq::oks::OksData::OksData ( const OksRelationship * r,
const OksXmlRelValue & value )
inlineprivate

Definition at line 1043 of file object.hpp.

1044 {
1045 Clear2();
1046 read(r, value);
1047 }

◆ OksData() [36/36]

dunedaq::oks::OksData::OksData ( const OksRelationship * r,
const oks::ReadFileParams & params )
inlineprivate

Definition at line 1048 of file object.hpp.

1049 {
1050 Clear2();
1051 read(r, params);
1052 }

Member Function Documentation

◆ __cn()

const std::string & dunedaq::oks::OksData::__cn ( ) const
private

◆ __oid()

const std::string & dunedaq::oks::OksData::__oid ( ) const
private

◆ check_range()

void dunedaq::oks::OksData::check_range ( const OksAttribute * a) const

Check range of data.

The method checks that the data matches to the range. If the data is out of range, the oks::AttributeRangeError exception is thrown. If definition of range is bad, then the oks::AttributeReadError exception is thrown.

Parameters
aattribute defining the range (UML syntax, e.g. "A,B,C" or "1..10" or "*..99")
Exceptions
oks::AttributeRangeErroror oks::AttributeReadError is thrown in case of problems.

◆ Clear()

void dunedaq::oks::OksData::Clear ( )

◆ Clear2()

void dunedaq::oks::OksData::Clear2 ( )
inline

Definition at line 709 of file object.hpp.

709{ type = unknown_type; }

◆ ConvertTo()

void dunedaq::oks::OksData::ConvertTo ( OksData * ,
const OksRelationship *  ) const

◆ copy()

void dunedaq::oks::OksData::copy ( const OksData & )
private

◆ cvt()

void dunedaq::oks::OksData::cvt ( OksData * to,
const OksAttribute * attr ) const

Convert data to new type.

The method converts this data to the new data using type defined by attribute parameter. A single-value can be converted to multi-value conta4ining this single item. A multi-value can be converted to single-value using first item from the multi-value.

If data cannot be converted, then the oks::AttributeReadError exception is thrown.

Parameters
toout parameter (new data containing converted value)
attrpointer to OKS kernel (required to read class_type values)
Exceptions
oks::AttributeReadErroris thrown in case of problems.

◆ date()

boost::gregorian::date dunedaq::oks::OksData::date ( ) const
noexcept

◆ is_g()

bool dunedaq::oks::OksData::is_g ( const OksData & ) const
privatenoexcept

◆ is_ge()

bool dunedaq::oks::OksData::is_ge ( const OksData & ) const
privatenoexcept

◆ is_l()

bool dunedaq::oks::OksData::is_l ( const OksData & ) const
privatenoexcept

◆ is_le()

bool dunedaq::oks::OksData::is_le ( const OksData & ) const
privatenoexcept

◆ is_object()

bool dunedaq::oks::OksData::is_object ( Type t)
inlinestatic

Definition at line 990 of file object.hpp.

990{ return (t == object_type || t == uid_type || t == uid2_type); }

◆ IsConsistent()

bool dunedaq::oks::OksData::IsConsistent ( const OksRelationship * r,
const OksObject * o,
const char * msg )
private

◆ operator delete()

void dunedaq::oks::OksData::operator delete ( void * ptr)
inline

Definition at line 986 of file object.hpp.

986{ boost::fast_pool_allocator<OksData>::deallocate(reinterpret_cast<OksData*>(ptr)); }

◆ operator new()

void * dunedaq::oks::OksData::operator new ( size_t )
inline

Definition at line 985 of file object.hpp.

985{ return boost::fast_pool_allocator<OksData>::allocate(); }

◆ operator!=()

bool dunedaq::oks::OksData::operator!= ( const OksData & ) const

◆ operator<()

bool dunedaq::oks::OksData::operator< ( const OksData & ) const

◆ operator<=()

bool dunedaq::oks::OksData::operator<= ( const OksData & ) const

◆ operator=()

OksData & dunedaq::oks::OksData::operator= ( const OksData & d)
inline

Definition at line 961 of file object.hpp.

962 {
963 if (&d != this) {
964 Clear();
965 copy(d);
966 }
967
968 return *this;
969 }

◆ operator==()

bool dunedaq::oks::OksData::operator== ( const OksData & ) const

◆ operator>()

bool dunedaq::oks::OksData::operator> ( const OksData & ) const

◆ operator>=()

bool dunedaq::oks::OksData::operator>= ( const OksData & ) const

◆ read() [1/8]

void dunedaq::oks::OksData::read ( const oks::ReadFileParams & ,
const OksAttribute *  )
private

◆ read() [2/8]

void dunedaq::oks::OksData::read ( const oks::ReadFileParams & ,
const OksAttribute * ,
int32_t  )
private

private methods which can be used by OksObject class only

◆ read() [3/8]

void dunedaq::oks::OksData::read ( const oks::ReadFileParams & ,
const OksRelationship *  )
private

◆ read() [4/8]

void dunedaq::oks::OksData::read ( const oks::ReadFileParams & ,
const OksRelationship * ,
int32_t  )
private

◆ read() [5/8]

void dunedaq::oks::OksData::read ( const OksAttribute * ,
const oks::ReadFileParams &  )
private

◆ read() [6/8]

void dunedaq::oks::OksData::read ( const OksAttribute * ,
const OksXmlValue &  )
private

◆ read() [7/8]

void dunedaq::oks::OksData::read ( const OksRelationship * ,
const oks::ReadFileParams &  )
private

◆ read() [8/8]

void dunedaq::oks::OksData::read ( const OksRelationship * ,
const OksXmlRelValue &  )
private

◆ ReadFrom() [1/3]

void dunedaq::oks::OksData::ReadFrom ( const char * s,
Type t,
const OksAttribute * a )
inline

Read from string using non multi-value type

Exceptions
oks::AttributeReadErroris thrown in case of problems.

Definition at line 1063 of file object.hpp.

1064{
1065 Clear();
1066 type = t;
1067 SetValue(s, a);
1068}
void SetValue(const char *s, const OksAttribute *a)

◆ ReadFrom() [2/3]

void dunedaq::oks::OksData::ReadFrom ( const OksRelationship * )
noexcept

Create emtpy list or empty uid2

◆ ReadFrom() [3/3]

void dunedaq::oks::OksData::ReadFrom ( const std::string & s,
const OksAttribute * a )
inline

Read from string using non multi-value type

Exceptions
oks::AttributeReadErroris thrown in case of problems.

Definition at line 602 of file attribute.hpp.

603{
605 data.STRING = new OksString(s);
606 else if (type == OksData::enum_type)
607 data.ENUMERATION = a->get_enum_value(s);
608 else
609 SetValue(s.c_str(), a);
610}
OksString()
to deallocate memory when destroyed
Definition object.hpp:421
union dunedaq::oks::OksData::Data data
const std::string * ENUMERATION
Definition object.hpp:571

◆ Set() [1/24]

void dunedaq::oks::OksData::Set ( bool b)
inline

Definition at line 771 of file object.hpp.

772 {
773 Clear();
774 type = bool_type;
775 data.BOOL = b;
776 }

◆ Set() [2/24]

void dunedaq::oks::OksData::Set ( boost::gregorian::date d)
inline

Definition at line 779 of file object.hpp.

780 {
781 Clear();
782 type = date_type;
783 SetFast(d);
784 }
void SetFast(boost::gregorian::date d)

◆ Set() [3/24]

void dunedaq::oks::OksData::Set ( boost::posix_time::ptime t)
inline

Definition at line 785 of file object.hpp.

786 {
787 Clear();
788 type = time_type;
789 SetFast(t);
790 }

◆ Set() [4/24]

void dunedaq::oks::OksData::Set ( const char * s)
inline

Definition at line 797 of file object.hpp.

798 {
799 Clear();
801 data.STRING = new OksString(s);
802 }

◆ Set() [5/24]

void dunedaq::oks::OksData::Set ( const double & d)
inline

Definition at line 765 of file object.hpp.

◆ Set() [6/24]

void dunedaq::oks::OksData::Set ( const float & f)
inline

Definition at line 759 of file object.hpp.

◆ Set() [7/24]

void dunedaq::oks::OksData::Set ( const OksClass * c)
inline

Definition at line 815 of file object.hpp.

816 {
817 Clear();
819 data.CLASS = c;
820 }
const OksClass * CLASS
Definition object.hpp:555

◆ Set() [8/24]

void dunedaq::oks::OksData::Set ( const OksClass * c,
const OksString & s )
inline

Definition at line 838 of file object.hpp.

839 {
840 Clear();
841 type = uid_type;
842 data.UID.class_id = c;
843 data.UID.object_id = new OksString(s);
844 }
struct dunedaq::oks::OksData::Data::@266171337063116272021017117226020166361213322350 UID

◆ Set() [9/24]

void dunedaq::oks::OksData::Set ( const OksClass * c,
OksString * s )
inline

Definition at line 845 of file object.hpp.

846 {
847 Clear();
848 type = uid_type;
849 data.UID.class_id = c;
850 data.UID.object_id = s;
851 }

◆ Set() [10/24]

void dunedaq::oks::OksData::Set ( const OksString & c,
const OksString & s )
inline

Definition at line 852 of file object.hpp.

853 {
854 Clear();
855 type = uid2_type;
856 data.UID2.class_id = new OksString(c);
857 data.UID2.object_id = new OksString(s);
858 }
struct dunedaq::oks::OksData::Data::@226266061051241020017305361066131172152317024337 UID2

◆ Set() [11/24]

void dunedaq::oks::OksData::Set ( const OksString & s)
inline

Definition at line 809 of file object.hpp.

810 {
811 Clear();
813 data.STRING = new OksString(s);
814 }

◆ Set() [12/24]

void dunedaq::oks::OksData::Set ( const std::string & s)
inline

Definition at line 803 of file object.hpp.

804 {
805 Clear();
807 data.STRING = new OksString(s);
808 }

◆ Set() [13/24]

void dunedaq::oks::OksData::Set ( int16_t i)
inline

Definition at line 723 of file object.hpp.

724 {
725 Clear();
727 data.S16_INT = i;
728 }

◆ Set() [14/24]

void dunedaq::oks::OksData::Set ( int32_t i)
inline

Definition at line 735 of file object.hpp.

736 {
737 Clear();
739 data.S32_INT = i;
740 }

◆ Set() [15/24]

void dunedaq::oks::OksData::Set ( int64_t i)
inline

Definition at line 747 of file object.hpp.

748 {
749 Clear();
751 data.S64_INT = i;
752 }

◆ Set() [16/24]

void dunedaq::oks::OksData::Set ( int8_t c)
inline

Definition at line 711 of file object.hpp.

712 {
713 Clear();
715 data.S8_INT = c;
716 }

◆ Set() [17/24]

void dunedaq::oks::OksData::Set ( List * l)
inline

Definition at line 826 of file object.hpp.

◆ Set() [18/24]

void dunedaq::oks::OksData::Set ( OksObject * o)
inline

Definition at line 832 of file object.hpp.

833 {
834 Clear();
836 data.OBJECT = o;
837 }

◆ Set() [19/24]

void dunedaq::oks::OksData::Set ( OksString * c,
OksString * s )
inline

Definition at line 859 of file object.hpp.

860 {
861 Clear();
862 type = uid2_type;
863 data.UID2.class_id = c;
864 data.UID2.object_id = s;
865 }

◆ Set() [20/24]

void dunedaq::oks::OksData::Set ( OksString * s)
inline

Definition at line 791 of file object.hpp.

792 {
793 Clear();
795 data.STRING = s;
796 }

◆ Set() [21/24]

void dunedaq::oks::OksData::Set ( uint16_t i)
inline

Definition at line 729 of file object.hpp.

730 {
731 Clear();
733 data.U16_INT = i;
734 }

◆ Set() [22/24]

void dunedaq::oks::OksData::Set ( uint32_t i)
inline

Definition at line 741 of file object.hpp.

742 {
743 Clear();
745 data.U32_INT = i;
746 }

◆ Set() [23/24]

void dunedaq::oks::OksData::Set ( uint64_t i)
inline

Definition at line 753 of file object.hpp.

754 {
755 Clear();
757 data.U64_INT = i;
758 }

◆ Set() [24/24]

void dunedaq::oks::OksData::Set ( uint8_t c)
inline

Definition at line 717 of file object.hpp.

718 {
719 Clear();
721 data.U8_INT = c;
722 }

◆ set_init_value()

void dunedaq::oks::OksData::set_init_value ( const OksAttribute * attr,
bool skip_init )

Set value defined by initial value of attribute.

The method checks that the data matches to the range. If the data is out of range, the oks::AttributeRangeError exception is thrown. If definition of range is bad, then the oks::AttributeReadError exception is thrown.

Parameters
attrthe attribute
kernelpointer to OKS kernel (required to read class_type values)
skip_initonly required by OksObject::init2() method for optimization
Exceptions
oks::AttributeReadErroris thrown in case of problems.

Definition at line 248 of file object.cpp.

249{
250 bool si = (a->get_init_value().empty() || skip_init);
251
252 if (a->get_is_multi_values() == false) {
253 type = a->get_data_type();
254 if (si) {
255 SetNullValue(a);
256 } else {
257 if (type == OksData::string_type) {
258 data.STRING = new OksString(a->get_init_value());
259 } else if (type == OksData::enum_type) {
260 data.ENUMERATION = a->get_enum_value(a->get_init_value());
261 } else {
262 SetValue(a->get_init_value().c_str(), a);
263 }
264 }
265 } else {
266 if (si) {
267 SetValues("", a);
268 } else {
269 SetValues(a->get_init_value().c_str(), a);
270 }
271 }
272}
void SetNullValue(const OksAttribute *a)
void SetValues(const char *, const OksAttribute *a)

◆ SetE() [1/5]

void dunedaq::oks::OksData::SetE ( const char * s,
size_t len,
const OksAttribute * a )
inline

Definition at line 568 of file attribute.hpp.

569{
570 Clear();
571 type = enum_type;
572 data.ENUMERATION = a->get_enum_value(s, len);
573}

◆ SetE() [2/5]

void dunedaq::oks::OksData::SetE ( const OksAttribute * a)
inline

Definition at line 584 of file attribute.hpp.

585{
586 Clear();
587 type = enum_type;
588 data.ENUMERATION = &((*(a->p_enumerators))[0]);
589}

◆ SetE() [3/5]

void dunedaq::oks::OksData::SetE ( const OksString & s,
const OksAttribute * a )
inline

Definition at line 592 of file attribute.hpp.

593{
594 Clear();
595 type = enum_type;
596 data.ENUMERATION = a->get_enum_value(s);
597}

◆ SetE() [4/5]

void dunedaq::oks::OksData::SetE ( const std::string & s,
const OksAttribute * a )
inline

Definition at line 576 of file attribute.hpp.

577{
578 Clear();
579 type = enum_type;
580 data.ENUMERATION = a->get_enum_value(s);
581}

◆ SetE() [5/5]

void dunedaq::oks::OksData::SetE ( OksString * s,
const OksAttribute * a )
inline

◆ SetFast() [1/2]

void dunedaq::oks::OksData::SetFast ( boost::gregorian::date d)

◆ SetFast() [2/2]

void dunedaq::oks::OksData::SetFast ( boost::posix_time::ptime t)

◆ SetNullValue()

void dunedaq::oks::OksData::SetNullValue ( const OksAttribute * a)

Read from null string (single-value)

Exceptions
oks::AttributeReadErroris thrown in case of problems.

◆ SetValue()

void dunedaq::oks::OksData::SetValue ( const char * s,
const OksAttribute * a )

Read from string (single-value)

Exceptions
oks::AttributeReadErroris thrown in case of problems.

◆ SetValues()

void dunedaq::oks::OksData::SetValues ( const char * ,
const OksAttribute * a )

Read from string (any type)

Exceptions
oks::AttributeReadErroris thrown in case of problems.

◆ sort()

void dunedaq::oks::OksData::sort ( bool ascending = true)

◆ str() [1/2]

std::string dunedaq::oks::OksData::str ( const OksKernel * ) const

◆ str() [2/2]

std::string dunedaq::oks::OksData::str ( int base = 0) const

◆ time()

boost::posix_time::ptime dunedaq::oks::OksData::time ( ) const
noexcept

◆ WriteTo() [1/3]

void dunedaq::oks::OksData::WriteTo ( OksXmlOutputStream & ) const

◆ WriteTo() [2/3]

void dunedaq::oks::OksData::WriteTo ( OksXmlOutputStream & ,
bool  ) const

◆ WriteTo() [3/3]

void dunedaq::oks::OksData::WriteTo ( OksXmlOutputStream & ,
OksKernel * ,
OksAliasTable * ,
bool ,
bool  ) const
private

◆ OksKernel

friend class OksKernel
friend

Definition at line 512 of file object.hpp.

◆ OksObject

friend class OksObject
friend

Definition at line 511 of file object.hpp.

◆ operator<<

std::ostream & operator<< ( std::ostream & ,
const OksData &  )
friend

Member Data Documentation

◆ data

union dunedaq::oks::OksData::Data dunedaq::oks::OksData::data

◆ type

enum dunedaq::oks::OksData::Type dunedaq::oks::OksData::type

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