DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbe::actions::object::create Class Reference

#include <Command.hpp>

Inheritance diagram for dbe::actions::object::create:
[legend]
Collaboration diagram for dbe::actions::object::create:
[legend]

Public Member Functions

 create (dbe::t_config_object_preimage const &img, QUuid const &src=0, QUndoCommand *parent=0)
void undo ()
void redo ()
Public Member Functions inherited from dbe::actions::state
bool isvalid () const
void toggle ()
void failed () const
void setundoable (bool s=true) const
void setredoable (bool s=true) const
bool undoable () const
bool redoable () const
void reload () const
QUuid const & source () const

Private Attributes

dbe::t_config_object_preimage this_object_key

Additional Inherited Members

Protected Member Functions inherited from dbe::actions::state
 state (QUndoCommand *parent=nullptr, QUuid const &uuid=0)

Detailed Description

Definition at line 85 of file Command.hpp.

Constructor & Destructor Documentation

◆ create()

dbe::actions::object::create::create ( dbe::t_config_object_preimage const & img,
QUuid const & src = 0,
QUndoCommand * parent = 0 )

Definition at line 182 of file Command.cpp.

183 : state(parent, src)
184 , this_object_key(img)
185{
186 setText(QObject::tr("Creation of : Object %2@%1 ")
187 .arg(this_object_key.ref.this_class.c_str())
188 .arg(this_object_key.ref.this_name.c_str()));
189}
dbe::t_config_object_preimage this_object_key
Definition Command.hpp:94
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:419

Member Function Documentation

◆ redo()

void dbe::actions::object::create::redo ( )

Definition at line 214 of file Command.cpp.

215{
216 try {
217 if (redoable()) {
218 failed();
221 toggle();
222 }
223 } catch (dunedaq::conffwk::Exception const& e) {
224 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, dbe::config::errors::parse(e));
225 }
226}
#define ERS_HERE
void failed() const
Definition Command.cpp:437
bool redoable() const
Definition Command.cpp:469
QUuid const & source() const
Definition Command.cpp:475
void force_emit_object_created(QString const &, dref const)
static confaccessor & ref()
static configobject::tref get(dbe::cokey const &desc)
static configobject::tref create_object_request(dbe::t_config_object_preimage const &rep)
std::string const parse(ers::Issue const &)

◆ undo()

void dbe::actions::object::create::undo ( )

Definition at line 192 of file Command.cpp.

193{
194 try {
195 if (undoable()) {
196 failed();
197 // notify for the objects that have been actually removed
200 };
201
204 toggle();
205 }
206 } catch (dunedaq::conffwk::Exception const& e) {
207 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, dbe::config::errors::parse(e));
208 } catch (daq::dbe::config_object_retrieval_result_is_null const& e) {
209 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, e);
210 }
211}
bool undoable() const
Definition Command.cpp:463
void force_emit_object_deleted(QString const &, dref const)
static configobject::gref< T > delete_object_request(configobject::tref const &obj)
config_object_description dref

Member Data Documentation

◆ this_object_key

dbe::t_config_object_preimage dbe::actions::object::create::this_object_key
private

Definition at line 94 of file Command.hpp.


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