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

OldValue
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 37 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 54 of file change_date.hpp.

56 : onobject ( Object, parent ),
59 Success ( true )
60{
61 try
62 {
66 }
67 catch ( dunedaq::conffwk::Exception const & )
68 {
69 }
70
71 setText (
72 QObject::tr ( "Attribute %1 of object %2 was updated." ).arg (
73 AttributeData.p_name.c_str() ).arg ( Object.UID().c_str() ) );
74}
dunedaq::conffwk::attribute_t Attribute
onobject(tref obj, QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:510
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 102 of file change_date.hpp.

103{
104 try
105 {
106 if ( isvalid() )
107 {
108 failed();
112
114 toggle();
115 }
116 }
117 catch ( dunedaq::conffwk::Exception const & e )
118 {
119 Success = false;
121 }
123 {
124 FAIL ( "Operation did not complete because a lookup in the underlying database failed",
125 ex.what() );
127 }
128
129}
tref checkedref() const
Definition Command.cpp:518
bool isvalid() const
Definition Command.cpp:548
void failed() const
Definition Command.cpp:541
#define FAIL(...)
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 77 of file change_date.hpp.

78{
79 try
80 {
81 if ( isvalid() )
82 {
83 failed();
85 toggle();
86 }
87 }
88 catch ( dunedaq::conffwk::Exception const & e )
89 {
90 Success = false;
92 }
94 {
95 FAIL ( "Operation did not complete because a lookup in the underlying database failed",
96 ex.what() );
98 }
99
100}

Member Data Documentation

◆ Attribute

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

Definition at line 49 of file change_date.hpp.

◆ NewValue

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

Definition at line 48 of file change_date.hpp.

◆ OldValue

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

Definition at line 47 of file change_date.hpp.

◆ Success

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

Definition at line 50 of file change_date.hpp.


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