DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbe::inner::configobject::gref< T > Class Template Reference

#include <config_reference_copy.hpp>

Public Types

typedef T t_extractor
typedef std::function< void(dref const) > config_action_notifiable

Public Member Functions

bool is_null () const
void notify (config_action_notifiable tele)

Private Types

typedef std::deque< t_extractortype_extractor_stack
typedef std::vector< dbe::treftype_ref_container

Private Member Functions

tref rebuild ()
void record (tref const &obj)
void post ()

Private Attributes

type_extractor_stack this_remove_stack
type_ref_container this_notify_stack

Friends

class inner::dbcontroller

Detailed Description

template<typename T = config_object_linker>
class dbe::inner::configobject::gref< T >

Holds a graph copy of the subgraph associated with the referenced object, which is the result of a deletion operation in dbcontroller. It can only be used to attempt reviving the object

The object copy can only be used for passing it to a dbcontroller for recreation of the associated objects. A gref does not support querying the underlying copy.

Definition at line 72 of file config_reference_copy.hpp.

Member Typedef Documentation

◆ config_action_notifiable

template<typename T = config_object_linker>
typedef std::function<void ( dref const ) > dbe::inner::configobject::gref< T >::config_action_notifiable

Definition at line 76 of file config_reference_copy.hpp.

◆ t_extractor

template<typename T = config_object_linker>
typedef T dbe::inner::configobject::gref< T >::t_extractor

Definition at line 75 of file config_reference_copy.hpp.

◆ type_extractor_stack

template<typename T = config_object_linker>
typedef std::deque<t_extractor> dbe::inner::configobject::gref< T >::type_extractor_stack
private

Definition at line 95 of file config_reference_copy.hpp.

◆ type_ref_container

template<typename T = config_object_linker>
typedef std::vector<dbe::tref> dbe::inner::configobject::gref< T >::type_ref_container
private

Definition at line 96 of file config_reference_copy.hpp.

Member Function Documentation

◆ is_null()

template<typename T>
bool dbe::inner::configobject::gref< T >::is_null ( ) const

Checks if the front of the queue is valid

Returns
true / false on condition evaluation of the state of the object at front

Definition at line 136 of file dbcontroller.cpp.

137{
138 return this_remove_stack.front().is_null();
139}

◆ notify()

template<typename T>
void dbe::inner::configobject::gref< T >::notify ( config_action_notifiable tele)

Passing a notifiable to permits to make a callback with the object and notify of it having been in different states in the the program structure. The notifiable actually determines what type of modification may be sent.

Parameters
teleis a notifiable that receives an object descriptor

Definition at line 96 of file dbcontroller.cpp.

97{
98 if (this_notify_stack.empty())
99 {
101 {
102 tele(val.ref);
103 }
104 }
105 else
106 {
108 {
109 tele(val);
110 }
111 }
112}

◆ post()

template<typename T>
void dbe::inner::configobject::gref< T >::post ( )
private

Filtering function checks after deletion of objects and keep only those that have been removed

Definition at line 78 of file dbcontroller.cpp.

79{
82
83 while (not acopy.empty())
84 {
85 t_extractor candidate = acopy.front();
86 // Keep only objects that have been deleted
88 candidate.ref.UID()))
89 {
91 }
92 acopy.pop_front();
93 }
94}

◆ rebuild()

template<typename T>
tref dbe::inner::configobject::gref< T >::rebuild ( )
private

Create the objects in the in the queue and return the last object created , i.e. the bottom of the queue.

Returns
the last object created

Definition at line 114 of file dbcontroller.cpp.

115{
116 if (not this_remove_stack.empty())
117 {
118 for (;;)
119 {
122 this_remove_stack.pop_front();
123 if (not last.is_null())
124 {
125 this_notify_stack.push_back(last);
126 }
127 if (this_remove_stack.empty())
128 {
129 return last;
130 }
131 }
132 }
134}
static configobject::tref create_object_request(dbe::t_config_object_preimage const &rep)

◆ record()

template<typename T>
void dbe::inner::configobject::gref< T >::record ( tref const & obj)
private

Include a ConfigObject and all its descendants

Parameters
obj

Definition at line 65 of file dbcontroller.cpp.

66{
68 for (auto const & linked : obj.relations)
69 {
70 for (auto const & candidate : linked.second)
71 {
72 record(candidate.ref());
73 }
74 }
75 this_remove_stack.push_back(obj);
76}

◆ inner::dbcontroller

template<typename T = config_object_linker>
friend class inner::dbcontroller
friend

Definition at line 123 of file config_reference_copy.hpp.

Member Data Documentation

◆ this_notify_stack

template<typename T = config_object_linker>
type_ref_container dbe::inner::configobject::gref< T >::this_notify_stack
private

Definition at line 121 of file config_reference_copy.hpp.

◆ this_remove_stack

template<typename T = config_object_linker>
type_extractor_stack dbe::inner::configobject::gref< T >::this_remove_stack
private

Definition at line 120 of file config_reference_copy.hpp.


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