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

#include <Command.hpp>

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

Public Member Functions

 remove (tref item, QUuid const &uuid=0, QUndoCommand *parent=0)
 ~remove ()
void redo ()
void undo ()
Public Member Functions inherited from dbe::actions::onobject
 onobject (tref obj, QUndoCommand *parent=nullptr, QUuid const &uuid=0)
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

gref this_remainder

Additional Inherited Members

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

Detailed Description

Definition at line 99 of file Command.hpp.

Constructor & Destructor Documentation

◆ remove()

dbe::actions::object::remove::remove ( tref item,
QUuid const & uuid = 0,
QUndoCommand * parent = 0 )

Definition at line 230 of file Command.cpp.

231 : onobject(anobject, parent, uuid)
232{
233 setText(QObject::tr("Delete object of class %1 with ID %2")
234 .arg((this->checkedref().class_name()).c_str())
235 .arg((this->checkedref().UID()).c_str()));
236}
tref checkedref() const
Definition Command.cpp:412
onobject(tref obj, QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:403
QUuid const uuid
Definition Command.hpp:34

◆ ~remove()

dbe::actions::object::remove::~remove ( )

Definition at line 238 of file Command.cpp.

238{}

Member Function Documentation

◆ redo()

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

Definition at line 262 of file Command.cpp.

263{
264 try {
265 if (redoable() and not checkedref().is_null()) {
266 failed();
267 // notify for the objects that have been actually removed
268 gref::config_action_notifiable deletion = [&](dref const obj) {
270 };
271
274 toggle();
275 }
276 } catch (dunedaq::conffwk::Exception const& e) {
277 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, dbe::config::errors::parse(e));
278 } catch (daq::dbe::config_object_retrieval_result_is_null const& ex) {
279 FAIL("Operation did not complete because a lookup in the underlying database failed", ex.what());
280 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, ex);
281 }
282}
#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_deleted(QString const &, dref const)
static confaccessor & ref()
static configobject::gref< T > delete_object_request(configobject::tref const &obj)
#define FAIL(...)
std::string const parse(ers::Issue const &)
config_object_description dref

◆ undo()

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

Definition at line 241 of file Command.cpp.

242{
243 try {
244 if (undoable()) {
245 failed();
246 gref::config_action_notifiable creation = [&](dref obj) {
248 };
249
251 toggle();
252 }
253 } catch (dunedaq::conffwk::Exception const& e) {
254 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, dbe::config::errors::parse(e));
255 } catch (daq::dbe::config_object_retrieval_result_is_null const& ex) {
256 FAIL("Operation did not complete because a lookup in the underlying database failed", ex.what());
257 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, ex);
258 }
259}
bool undoable() const
Definition Command.cpp:463
void force_emit_object_created(QString const &, dref const)
static configobject::tref create_object_request(dbe::t_config_object_preimage const &rep)

Member Data Documentation

◆ this_remainder

gref dbe::actions::object::remove::this_remainder
private

Definition at line 108 of file Command.hpp.


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