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

#include <change_time.hpp>

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

Public Member Functions

 ChangeTime (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::ChangeTime< T >

Definition at line 37 of file change_time.hpp.

Constructor & Destructor Documentation

◆ ChangeTime()

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

Definition at line 54 of file change_time.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::ChangeTime< T >::redo ( )

Definition at line 103 of file change_time.hpp.

104{
105 try
106 {
107 if ( redoable() )
108 {
109 failed();
110
113
115
117 toggle();
118 }
119 }
120 catch ( dunedaq::conffwk::Exception const & e )
121 {
122 Success = false;
124 }
126 {
127 FAIL ( "Operation did not complete because a lookup in the underlying database failed",
128 ex.what() );
130 }
131
132}
tref checkedref() const
Definition Command.cpp:518
void failed() const
Definition Command.cpp:541
bool redoable() const
Definition Command.cpp:568
#define FAIL(...)
void atime(inner::configobject::tref Object, dunedaq::conffwk::attribute_t const &AttributeData, T NewValueData, bool NotEmit=false)

◆ undo()

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

Definition at line 77 of file change_time.hpp.

78{
79 try
80 {
81 if ( undoable() )
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}
bool undoable() const
Definition Command.cpp:563

Member Data Documentation

◆ Attribute

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

Definition at line 49 of file change_time.hpp.

◆ NewValue

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

Definition at line 48 of file change_time.hpp.

◆ OldValue

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

Definition at line 47 of file change_time.hpp.

◆ Success

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

Definition at line 50 of file change_time.hpp.


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