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

#include <Command.hpp>

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

Public Member Functions

 remove (std::string &db_file, std::string &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 184 of file Command.hpp.

Constructor & Destructor Documentation

◆ remove()

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

Definition at line 165 of file Command.cpp.

167 : state ( parent, src ),
168 m_db_file ( db_file ),
169 m_include_file ( include_file )
170{
171 setText (
172 QObject::tr ( "Remove Include File %1 to %2" ).arg (
173 QFileInfo ( QString ( m_include_file.c_str() ) ).fileName() ).arg (
174 QFileInfo ( QString ( m_db_file.c_str() ) ).fileName() ) );
175}
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:520

Member Function Documentation

◆ redo()

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

Definition at line 194 of file Command.cpp.

195{
196 try
197 {
198 if ( redoable() )
199 {
200 failed();
202 toggle();
203 }
204 }
205 catch ( dunedaq::conffwk::Exception const & e )
206 {
207 throw daq::dbe::DatabaseChangeNotSuccessful ( ERS_HERE, dbe::config::errors::parse ( e ) );
208 }
209}
#define ERS_HERE
void failed() const
Definition Command.cpp:536
bool redoable() const
Definition Command.cpp:563
void removefile(std::string const &db, std::string const &fn)
static confaccessor & ref()
std::string const parse(ers::Issue const &)

◆ undo()

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

Definition at line 177 of file Command.cpp.

178{
179 try
180 {
181 if ( undoable() )
182 {
183 failed();
185 toggle();
186 }
187 }
188 catch ( dunedaq::conffwk::Exception const & e )
189 {
190 throw daq::dbe::DatabaseChangeNotSuccessful ( ERS_HERE, dbe::config::errors::parse ( e ) );
191 }
192}
bool undoable() const
Definition Command.cpp:558
void addfile(std::string const &db, std::string const &fn)

Member Data Documentation

◆ m_db_file

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

Definition at line 193 of file Command.hpp.

◆ m_include_file

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

Definition at line 194 of file Command.hpp.


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