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

#include <change_date.hpp>

Inheritance diagram for dbe::actions::ChangeDate< T >:
[legend]
Collaboration diagram for dbe::actions::ChangeDate< T >:
[legend]

Public Member Functions

 ChangeDate (tref Object, dunedaq::conffwk::attribute_t AttributeData, T NewValueData, QUndoCommand *parent=nullptr)
void undo ()
void redo ()
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

T OldValue
T NewValue
dunedaq::conffwk::attribute_t Attribute
bool Success

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

template<typename T>
class dbe::actions::ChangeDate< T >

Definition at line 35 of file change_date.hpp.

Constructor & Destructor Documentation

◆ ChangeDate()

template<typename T>
dbe::actions::ChangeDate< T >::ChangeDate ( tref Object,
dunedaq::conffwk::attribute_t AttributeData,
T NewValueData,
QUndoCommand * parent = nullptr )

Definition at line 50 of file change_date.hpp.

57 , Success(true)
58{
59 try {
62 } catch (dunedaq::conffwk::Exception const&) {
63 }
64
65 setText(
66 QObject::tr("Attribute %1 of object %2 was updated.").arg(AttributeData.p_name.c_str()).arg(Object.UID().c_str()));
67}
dunedaq::conffwk::attribute_t Attribute
onobject(tref obj, QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:403
static T list(dbe::inner::configobject::tref obj, dunedaq::conffwk::attribute_t const &attr)
T to(QStringList const &DataList)

Member Function Documentation

◆ redo()

template<typename T>
void dbe::actions::ChangeDate< T >::redo ( )

Definition at line 89 of file change_date.hpp.

90{
91 try {
92 if (isvalid()) {
93 failed();
96
98 toggle();
99 }
100 } catch (dunedaq::conffwk::Exception const& e) {
101 Success = false;
104 FAIL("Operation did not complete because a lookup in the underlying database failed", ex.what());
106 }
107}
tref checkedref() const
Definition Command.cpp:412
bool isvalid() const
Definition Command.cpp:445
void failed() const
Definition Command.cpp:437
void adate(inner::configobject::tref Object, dunedaq::conffwk::attribute_t const &AttributeData, T NewValueData, bool NotEmit=false)

◆ undo()

template<typename T>
void dbe::actions::ChangeDate< T >::undo ( )

Definition at line 71 of file change_date.hpp.

72{
73 try {
74 if (isvalid()) {
75 failed();
77 toggle();
78 }
79 } catch (dunedaq::conffwk::Exception const& e) {
80 Success = false;
83 FAIL("Operation did not complete because a lookup in the underlying database failed", ex.what());
85 }
86}

Member Data Documentation

◆ Attribute

template<typename T>
dunedaq::conffwk::attribute_t dbe::actions::ChangeDate< T >::Attribute
private

Definition at line 45 of file change_date.hpp.

◆ NewValue

template<typename T>
T dbe::actions::ChangeDate< T >::NewValue
private

Definition at line 44 of file change_date.hpp.

◆ OldValue

template<typename T>
T dbe::actions::ChangeDate< T >::OldValue
private

Definition at line 43 of file change_date.hpp.

◆ Success

template<typename T>
bool dbe::actions::ChangeDate< T >::Success
private

Definition at line 46 of file change_date.hpp.


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