DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::dfmodules::DataStoreConfTestDeriv Class Reference

#include <DataStoreConfTestDeriv.hpp>

Inheritance diagram for dunedaq::dfmodules::DataStoreConfTestDeriv:
[legend]
Collaboration diagram for dunedaq::dfmodules::DataStoreConfTestDeriv:
[legend]

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the DataStoreConfTestDeriv object.
virtual std::vector< const dunedaq::conffwk::DalObject * > get (const std::string &name, bool upcast_unregistered=true) const
 Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.
int32_t get_derivval () const
 Get "derivval" attribute value. A value used simply to demonstrate how there can be a non-generic configuration for a class which derives from FileDataStoreImpl.
void set_derivval (int32_t value)
 Set "derivval" attribute value. A value used simply to demonstrate how there can be a non-generic configuration for a class which derives from FileDataStoreImpl.
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the DataStoreConfTestDeriv object.
virtual std::vector< const dunedaq::conffwk::DalObject * > get (const std::string &name, bool upcast_unregistered=true) const
 Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.
int32_t get_derivval () const
 Get "derivval" attribute value. A value used simply to demonstrate how there can be a non-generic configuration for a class which derives from FileDataStoreImpl.
void set_derivval (int32_t value)
 Set "derivval" attribute value. A value used simply to demonstrate how there can be a non-generic configuration for a class which derives from FileDataStoreImpl.
Public Member Functions inherited from dunedaq::appmodel::DataStoreConf
const std::string & get_type () const
 Get "type" attribute value.
void set_type (const std::string &value)
 Set "type" attribute value.
const std::string & get_directory_path () const
 Get "directory_path" attribute value. The base directory for saving files.
void set_directory_path (const std::string &value)
 Set "directory_path" attribute value. The base directory for saving files.
const std::string & get_mode () const
 Get "mode" attribute value. The operation mode that the DataStore should use when organizing the data into files.
void set_mode (const std::string &value)
 Set "mode" attribute value. The operation mode that the DataStore should use when organizing the data into files.
uint64_t get_max_file_size () const
 Get "max_file_size" attribute value.
void set_max_file_size (uint64_t value)
 Set "max_file_size" attribute value.
bool get_disable_unique_filename_suffix () const
 Get "disable_unique_filename_suffix" attribute value.
void set_disable_unique_filename_suffix (bool value)
 Set "disable_unique_filename_suffix" attribute value.
int32_t get_free_space_safety_factor () const
 Get "free_space_safety_factor" attribute value.
void set_free_space_safety_factor (int32_t value)
 Set "free_space_safety_factor" attribute value.
uint8_t get_compression_level () const
 Get "compression_level" attribute value.
void set_compression_level (uint8_t value)
 Set "compression_level" attribute value.
const dunedaq::appmodel::HDF5FileLayoutParams * get_file_layout_params () const
 Get "file_layout_params" relationship value.
void set_file_layout_params (const dunedaq::appmodel::HDF5FileLayoutParams *value)
 Set "file_layout_params" relationship value.
const dunedaq::appmodel::FilenameParams * get_filename_params () const
 Get "filename_params" relationship value.
void set_filename_params (const dunedaq::appmodel::FilenameParams *value)
 Set "filename_params" relationship value.
const std::string & get_type () const
 Get "type" attribute value.
void set_type (const std::string &value)
 Set "type" attribute value.
const std::string & get_directory_path () const
 Get "directory_path" attribute value. The base directory for saving files.
void set_directory_path (const std::string &value)
 Set "directory_path" attribute value. The base directory for saving files.
const std::string & get_mode () const
 Get "mode" attribute value. The operation mode that the DataStore should use when organizing the data into files.
void set_mode (const std::string &value)
 Set "mode" attribute value. The operation mode that the DataStore should use when organizing the data into files.
uint64_t get_max_file_size () const
 Get "max_file_size" attribute value.
void set_max_file_size (uint64_t value)
 Set "max_file_size" attribute value.
bool get_disable_unique_filename_suffix () const
 Get "disable_unique_filename_suffix" attribute value.
void set_disable_unique_filename_suffix (bool value)
 Set "disable_unique_filename_suffix" attribute value.
int32_t get_free_space_safety_factor () const
 Get "free_space_safety_factor" attribute value.
void set_free_space_safety_factor (int32_t value)
 Set "free_space_safety_factor" attribute value.
uint8_t get_compression_level () const
 Get "compression_level" attribute value.
void set_compression_level (uint8_t value)
 Set "compression_level" attribute value.
const dunedaq::appmodel::HDF5FileLayoutParams * get_file_layout_params () const
 Get "file_layout_params" relationship value.
void set_file_layout_params (const dunedaq::appmodel::HDF5FileLayoutParams *value)
 Set "file_layout_params" relationship value.
const dunedaq::appmodel::FilenameParams * get_filename_params () const
 Get "filename_params" relationship value.
void set_filename_params (const dunedaq::appmodel::FilenameParams *value)
 Set "filename_params" relationship value.
Public Member Functions inherited from dunedaq::conffwk::DalObject
const std::string & UID () const noexcept
const std::string & class_name () const noexcept
bool castable (const std::string &target) const noexcept
bool castable (const std::string *target) const noexcept
template<class TARGET>
const TARGET * cast () const noexcept
 Casts object to different class.
std::string full_name () const noexcept
const ConfigObject & config_object () const
DalRegistry & registry () const noexcept
Configuration & configuration () const noexcept
void unread ()
void set (const ConfigObject &o) noexcept
void move (const std::string &at)
void rename (const std::string &new_id)
void p_hdr (std::ostream &s, unsigned int indent, const std::string &cl, const char *nm=nullptr) const
 print object headers
std::ostream & print_object (std::ostream &s) const
 print object details
void throw_init_ex (dunedaq::conffwk::Exception &ex)
 throw object initialisation exception (i.e.

Static Public Member Functions

static const std::string & __get_derivval_str () noexcept
static const std::string & __get_derivval_str () noexcept
Static Public Member Functions inherited from dunedaq::appmodel::DataStoreConf
static const std::string & __get_type_str () noexcept
static const std::string & __get_directory_path_str () noexcept
static const std::string & __get_mode_str () noexcept
static const std::string & __get_max_file_size_str () noexcept
static const std::string & __get_disable_unique_filename_suffix_str () noexcept
static const std::string & __get_free_space_safety_factor_str () noexcept
static const std::string & __get_compression_level_str () noexcept
static const std::string & __get_file_layout_params_str () noexcept
static const std::string & __get_filename_params_str () noexcept
static const std::string & __get_type_str () noexcept
static const std::string & __get_directory_path_str () noexcept
static const std::string & __get_mode_str () noexcept
static const std::string & __get_max_file_size_str () noexcept
static const std::string & __get_disable_unique_filename_suffix_str () noexcept
static const std::string & __get_free_space_safety_factor_str () noexcept
static const std::string & __get_compression_level_str () noexcept
static const std::string & __get_file_layout_params_str () noexcept
static const std::string & __get_filename_params_str () noexcept
Static Public Member Functions inherited from dunedaq::conffwk::DalObject
static void p_null (std::ostream &s)
 print "(null)"
static void p_rm (std::ostream &s)
 print "(deleted object)"
static void p_error (std::ostream &s, dunedaq::conffwk::Exception &ex)
 print error text
static void throw_get_ex (const std::string &what, const std::string &class_name, const DalObject *obj)
 throw exception in generated get method (i.e.
static bool is_null (const DalObject *ref) noexcept
 check a pointer on DAL object is null

Static Public Attributes

static const std::string & s_class_name
static const std::string s_derivval = "derivval"
Static Public Attributes inherited from dunedaq::appmodel::DataStoreConf
static const std::string & s_class_name
static const std::string s_type = "type"
static const std::string s_directory_path = "directory_path"
static const std::string s_mode = "mode"
static const std::string s_max_file_size = "max_file_size"
static const std::string s_disable_unique_filename_suffix = "disable_unique_filename_suffix"
static const std::string s_free_space_safety_factor = "free_space_safety_factor"
static const std::string s_compression_level = "compression_level"
static const std::string s_file_layout_params = "file_layout_params"
static const std::string s_filename_params = "filename_params"

Protected Member Functions

 DataStoreConfTestDeriv (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
virtual ~DataStoreConfTestDeriv () noexcept
virtual void init (bool init_children)
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 DataStoreConfTestDeriv (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
virtual ~DataStoreConfTestDeriv () noexcept
virtual void init (bool init_children)
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
Protected Member Functions inherited from dunedaq::appmodel::DataStoreConf
 DataStoreConf (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
virtual ~DataStoreConf () noexcept
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 DataStoreConf (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
virtual ~DataStoreConf () noexcept
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
Protected Member Functions inherited from dunedaq::conffwk::DalObject
 DalObject (DalRegistry &db, const ConfigObject &o) noexcept
virtual ~DalObject ()
void clear () noexcept
void check () const
bool is_deleted () const
void increment_created () noexcept
void increment_read () noexcept
void check_init () const
 Check and initialize object if necessary.
template<typename T>
void _set_object (const std::string &name, const T *value)
 Helper method for generated set single-value relationship methods.
template<typename T>
void _set_objects (const std::string &name, const std::vector< const T * > &value)
 Helper method for generated set multi-value relationship methods.
bool get_rel_objects (const std::string &name, bool upcast_unregistered, std::vector< const DalObject * > &objs) const
 Read relationship values as DAL objects using DAL factory.
bool get_algo_objects (const std::string &name, std::vector< const DalObject * > &objs) const
 Run algorithm and return result as DAL objects using DAL factory.

Private Attributes

int32_t m_derivval

Friends

class conffwk::Configuration
class conffwk::DalObject
class conffwk::DalFactory
class conffwk::DalRegistry

Additional Inherited Members

Protected Attributes inherited from dunedaq::conffwk::DalObject
std::mutex m_mutex
 Used to protect changes of DAL object.
bool p_was_read
 is true, if the object was read
DalRegistry & p_registry
 Configuration object.
ConfigObject p_obj
 Config object used by given template object.
std::string p_UID
 Is used for template objects (see dqm_conffwk).

Detailed Description

Definition at line 23 of file DataStoreConfTestDeriv.hpp.

Constructor & Destructor Documentation

◆ DataStoreConfTestDeriv() [1/2]

dunedaq::dfmodules::DataStoreConfTestDeriv::DataStoreConfTestDeriv ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

Definition at line 26 of file DataStoreConfTestDeriv.cpp.

26 :
27 dunedaq::conffwk::DalObject(db, o),
28 dunedaq::appmodel::DataStoreConf(db, o)
29
30 {
31 ;
32 }

◆ ~DataStoreConfTestDeriv() [1/2]

dunedaq::dfmodules::DataStoreConfTestDeriv::~DataStoreConfTestDeriv ( )
protectedvirtualnoexcept

Definition at line 75 of file DataStoreConfTestDeriv.cpp.

76 {
77 }

◆ DataStoreConfTestDeriv() [2/2]

dunedaq::dfmodules::DataStoreConfTestDeriv::DataStoreConfTestDeriv ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

◆ ~DataStoreConfTestDeriv() [2/2]

virtual dunedaq::dfmodules::DataStoreConfTestDeriv::~DataStoreConfTestDeriv ( )
protectedvirtualnoexcept

Member Function Documentation

◆ __get_derivval_str() [1/2]

const std::string & dunedaq::dfmodules::DataStoreConfTestDeriv::__get_derivval_str ( )
inlinestaticnoexcept

Definition at line 83 of file DataStoreConfTestDeriv.hpp.

83{ return s_derivval; }

◆ __get_derivval_str() [2/2]

const std::string & dunedaq::dfmodules::DataStoreConfTestDeriv::__get_derivval_str ( )
inlinestaticnoexcept

Definition at line 83 of file DataStoreConfTestDeriv.hpp.

83{ return s_derivval; }

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::dfmodules::DataStoreConfTestDeriv::get ( const std::string & name,
bool upcast_unregistered = true ) const
virtual

Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.

Parameters are:

Parameters
namename of the relationship or algorithm
Returns
value of relationship or result of algorithm
Exceptions
std::exceptionif there is no relationship or algorithm with such name in this and base classes

Reimplemented from dunedaq::appmodel::DataStoreConf.

Definition at line 79 of file DataStoreConfTestDeriv.cpp.

80 {
81 std::vector<const dunedaq::conffwk::DalObject *> vec;
82
83 if (!get(name, vec, upcast_unregistered, true))
84 throw_get_ex(name, s_class_name, this);
85
86 return vec;
87 }
static void throw_get_ex(const std::string &what, const std::string &class_name, const DalObject *obj)
throw exception in generated get method (i.e.
Definition DalObject.cpp:81
virtual std::vector< const dunedaq::conffwk::DalObject * > get(const std::string &name, bool upcast_unregistered=true) const
Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject...

◆ get() [2/4]

virtual std::vector< const dunedaq::conffwk::DalObject * > dunedaq::dfmodules::DataStoreConfTestDeriv::get ( const std::string & name,
bool upcast_unregistered = true ) const
virtual

Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.

Parameters are:

Parameters
namename of the relationship or algorithm
Returns
value of relationship or result of algorithm
Exceptions
std::exceptionif there is no relationship or algorithm with such name in this and base classes

Reimplemented from dunedaq::appmodel::DataStoreConf.

◆ get() [3/4]

bool dunedaq::dfmodules::DataStoreConfTestDeriv::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

Definition at line 89 of file DataStoreConfTestDeriv.cpp.

90 {
91 if (first_call)
92 {
93 std::lock_guard scoped_lock(m_mutex);
94
95 check();
96 check_init();
97
98 if (get_rel_objects(name, upcast_unregistered, vec))
99 return true;
100 }
101
102 if (DataStoreConf::get(name, vec, upcast_unregistered, false)) return true;
103
104 if (first_call)
105 return get_algo_objects(name, vec);
106
107 return false;
108 }
bool get_rel_objects(const std::string &name, bool upcast_unregistered, std::vector< const DalObject * > &objs) const
Read relationship values as DAL objects using DAL factory.
Definition DalObject.cpp:7
std::mutex m_mutex
Used to protect changes of DAL object.
bool get_algo_objects(const std::string &name, std::vector< const DalObject * > &objs) const
Run algorithm and return result as DAL objects using DAL factory.
Definition DalObject.cpp:22
void check_init() const
Check and initialize object if necessary.

◆ get() [4/4]

bool dunedaq::dfmodules::DataStoreConfTestDeriv::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

◆ get_derivval() [1/2]

int32_t dunedaq::dfmodules::DataStoreConfTestDeriv::get_derivval ( ) const
inline

Get "derivval" attribute value. A value used simply to demonstrate how there can be a non-generic configuration for a class which derives from FileDataStoreImpl.

Returns
the attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 94 of file DataStoreConfTestDeriv.hpp.

95 {
96 std::lock_guard scoped_lock(m_mutex);
97 check();
98 check_init();
99 return m_derivval;
100 }

◆ get_derivval() [2/2]

int32_t dunedaq::dfmodules::DataStoreConfTestDeriv::get_derivval ( ) const
inline

Get "derivval" attribute value. A value used simply to demonstrate how there can be a non-generic configuration for a class which derives from FileDataStoreImpl.

Returns
the attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 94 of file DataStoreConfTestDeriv.hpp.

95 {
96 std::lock_guard scoped_lock(m_mutex);
97 check();
98 check_init();
99 return m_derivval;
100 }

◆ init() [1/2]

void dunedaq::dfmodules::DataStoreConfTestDeriv::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::appmodel::DataStoreConf.

Definition at line 61 of file DataStoreConfTestDeriv.cpp.

62 {
63 DataStoreConf::init(init_children);
64
65 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
66
67 try {
69 }
70 catch (dunedaq::conffwk::Exception & ex) {
71 throw_init_ex(ex);
72 }
73 }
void get(const std::string &name, T &value)
Get value of object's attribute or relationship.
void throw_init_ex(dunedaq::conffwk::Exception &ex)
throw object initialisation exception (i.e.
Definition DalObject.cpp:72
ConfigObject p_obj
Config object used by given template object.
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:116

◆ init() [2/2]

virtual void dunedaq::dfmodules::DataStoreConfTestDeriv::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::appmodel::DataStoreConf.

◆ print() [1/2]

void dunedaq::dfmodules::DataStoreConfTestDeriv::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the DataStoreConfTestDeriv object.

Parameters are:

Parameters
offsetnumber of spaces to shift object right (useful to print nested objects)
print_headerif false, do not print object header (to print attributes of base classes)
soutput stream

Reimplemented from dunedaq::appmodel::DataStoreConf.

Definition at line 35 of file DataStoreConfTestDeriv.cpp.

36 {
37 check_init();
38
39 try {
40 const std::string str(indent+2, ' ');
41
42 if (print_header)
43 p_hdr(s, indent, s_class_name, "dunedaq::dfmodules");
44
45
46 // print direct super-classes
47
49
50
51 // print direct attributes
52
54 }
55 catch (dunedaq::conffwk::Exception & ex) {
57 }
58 }
virtual void print(unsigned int offset, bool print_header, std::ostream &s) const
Print details of the DataStoreConf object.
void p_hdr(std::ostream &s, unsigned int indent, const std::string &cl, const char *nm=nullptr) const
print object headers
Definition DalObject.cpp:62
static void p_error(std::ostream &s, dunedaq::conffwk::Exception &ex)
print error text
Definition DalObject.cpp:56
void p_sv_attr(std::ostream &s, const std::string &str, const std::string &name, const T &val) noexcept
print single-value attribute

◆ print() [2/2]

virtual void dunedaq::dfmodules::DataStoreConfTestDeriv::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the DataStoreConfTestDeriv object.

Parameters are:

Parameters
offsetnumber of spaces to shift object right (useful to print nested objects)
print_headerif false, do not print object header (to print attributes of base classes)
soutput stream

Reimplemented from dunedaq::appmodel::DataStoreConf.

◆ set_derivval() [1/2]

void dunedaq::dfmodules::DataStoreConfTestDeriv::set_derivval ( int32_t value)
inline

Set "derivval" attribute value. A value used simply to demonstrate how there can be a non-generic configuration for a class which derives from FileDataStoreImpl.

Parameters
valuenew attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 110 of file DataStoreConfTestDeriv.hpp.

111 {
112 std::lock_guard scoped_lock(m_mutex);
113 check();
114 clear();
116 }
void set_by_val(const std::string &name, T value)
Set attribute value.

◆ set_derivval() [2/2]

void dunedaq::dfmodules::DataStoreConfTestDeriv::set_derivval ( int32_t value)
inline

Set "derivval" attribute value. A value used simply to demonstrate how there can be a non-generic configuration for a class which derives from FileDataStoreImpl.

Parameters
valuenew attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 110 of file DataStoreConfTestDeriv.hpp.

111 {
112 std::lock_guard scoped_lock(m_mutex);
113 check();
114 clear();
116 }

◆ conffwk::Configuration

Definition at line 25 of file DataStoreConfTestDeriv.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 27 of file DataStoreConfTestDeriv.hpp.

◆ conffwk::DalObject

Definition at line 26 of file DataStoreConfTestDeriv.hpp.

◆ conffwk::DalRegistry

Definition at line 28 of file DataStoreConfTestDeriv.hpp.

Member Data Documentation

◆ m_derivval

int32_t dunedaq::dfmodules::DataStoreConfTestDeriv::m_derivval
private

Definition at line 74 of file DataStoreConfTestDeriv.hpp.

◆ s_class_name

const std::string & dunedaq::dfmodules::DataStoreConfTestDeriv::s_class_name
static

The name of the configuration class.

Definition at line 40 of file DataStoreConfTestDeriv.hpp.

◆ s_derivval

const std::string dunedaq::dfmodules::DataStoreConfTestDeriv::s_derivval = "derivval"
inlinestatic

Definition at line 81 of file DataStoreConfTestDeriv.hpp.


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