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

#include <Command.hpp>

Inheritance diagram for dbe::actions::file::add:
[legend]
Collaboration diagram for dbe::actions::file::add:
[legend]

Public Member Functions

 add (std::string const &db_file, std::string const &include_file, QUuid const &src=0, QUndoCommand *parent=0)
 
void redo ()
 
void undo ()
 
- 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

std::string m_db_file
 
std::string m_include_file
 

Additional Inherited Members

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

Detailed Description

Definition at line 169 of file Command.hpp.

Constructor & Destructor Documentation

◆ add()

dbe::actions::file::add::add ( std::string const & db_file,
std::string const & include_file,
QUuid const & src = 0,
QUndoCommand * parent = 0 )

Definition at line 113 of file Command.cpp.

116 : state ( parent, src ),
117 m_db_file ( db_file ),
118 m_include_file ( include_file )
119{
120 setText (
121 QObject::tr ( "Add Include File %1 to %2" ).arg (
122 QFileInfo ( QString ( m_include_file.c_str() ) ).fileName() ).arg (
123 QFileInfo ( QString ( m_db_file.c_str() ) ).fileName() ) );
124}
std::string m_include_file
Definition Command.hpp:179
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:520

Member Function Documentation

◆ redo()

void dbe::actions::file::add::redo ( )

Definition at line 146 of file Command.cpp.

147{
148 try
149 {
150 if ( redoable() )
151 {
152 failed();
154 toggle();
155 }
156 }
157 catch ( dunedaq::conffwk::Exception const & e )
158 {
159 throw daq::dbe::DatabaseChangeNotSuccessful ( ERS_HERE, dbe::config::errors::parse ( e ) );
160 }
161}
#define ERS_HERE
void failed() const
Definition Command.cpp:536
bool redoable() const
Definition Command.cpp:563
static confaccessor & ref()
void addfile(std::string const &db, std::string const &fn)
std::string const parse(ers::Issue const &)

◆ undo()

void dbe::actions::file::add::undo ( )

Definition at line 128 of file Command.cpp.

129{
130 try
131 {
132 if ( undoable() )
133 {
135 }
136 }
137 catch ( dunedaq::conffwk::Exception const & e )
138 {
139 failed();
140 throw daq::dbe::DatabaseChangeNotSuccessful ( ERS_HERE, dbe::config::errors::parse ( e ) );
141 }
142}
bool undoable() const
Definition Command.cpp:558
void removefile(std::string const &db, std::string const &fn)

Member Data Documentation

◆ m_db_file

std::string dbe::actions::file::add::m_db_file
private

Definition at line 178 of file Command.hpp.

◆ m_include_file

std::string dbe::actions::file::add::m_include_file
private

Definition at line 179 of file Command.hpp.


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