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 189 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 170 of file Command.cpp.

172 : state ( parent, src ),
173 m_db_file ( db_file ),
174 m_include_file ( include_file )
175{
176 setText (
177 QObject::tr ( "Remove Include File %1 to %2" ).arg (
178 QFileInfo ( QString ( m_include_file.c_str() ) ).fileName() ).arg (
179 QFileInfo ( QString ( m_db_file.c_str() ) ).fileName() ) );
180}
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:525

Member Function Documentation

◆ redo()

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

Definition at line 199 of file Command.cpp.

200{
201 try
202 {
203 if ( redoable() )
204 {
205 failed();
207 toggle();
208 }
209 }
210 catch ( dunedaq::conffwk::Exception const & e )
211 {
212 throw daq::dbe::DatabaseChangeNotSuccessful ( ERS_HERE, dbe::config::errors::parse ( e ) );
213 }
214}
#define ERS_HERE
void failed() const
Definition Command.cpp:541
bool redoable() const
Definition Command.cpp:568
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 182 of file Command.cpp.

183{
184 try
185 {
186 if ( undoable() )
187 {
188 failed();
190 toggle();
191 }
192 }
193 catch ( dunedaq::conffwk::Exception const & e )
194 {
195 throw daq::dbe::DatabaseChangeNotSuccessful ( ERS_HERE, dbe::config::errors::parse ( e ) );
196 }
197}
bool undoable() const
Definition Command.cpp:563
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 198 of file Command.hpp.

◆ m_include_file

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

Definition at line 199 of file Command.hpp.


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