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 180 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 139 of file Command.cpp.

143 : state(parent, src)
144 , m_db_file(db_file)
145 , m_include_file(include_file)
146{
147 setText(QObject::tr("Remove Include File %1 from %2")
148 .arg(QFileInfo(QString(m_include_file.c_str())).fileName())
149 .arg(QFileInfo(QString(m_db_file.c_str())).fileName()));
150}
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:419

Member Function Documentation

◆ redo()

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

Definition at line 167 of file Command.cpp.

168{
169 try {
170 if (redoable()) {
171 failed();
173 toggle();
174 }
175 } catch (dunedaq::conffwk::Exception const& e) {
176 throw daq::dbe::DatabaseChangeNotSuccessful(ERS_HERE, dbe::config::errors::parse(e));
177 }
178}
#define ERS_HERE
void failed() const
Definition Command.cpp:437
bool redoable() const
Definition Command.cpp:469
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 153 of file Command.cpp.

154{
155 try {
156 if (undoable()) {
157 failed();
159 toggle();
160 }
161 } catch (dunedaq::conffwk::Exception const& e) {
162 throw daq::dbe::DatabaseChangeNotSuccessful(ERS_HERE, dbe::config::errors::parse(e));
163 }
164}
bool undoable() const
Definition Command.cpp:463
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 188 of file Command.hpp.

◆ m_include_file

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

Definition at line 189 of file Command.hpp.


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