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

#include <Command.hpp>

Inheritance diagram for dbe::actions::state:
[legend]
Collaboration diagram for dbe::actions::state:
[legend]

Public Member Functions

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

Protected Member Functions

 state (QUndoCommand *parent=nullptr, QUuid const &uuid=0)

Private Member Functions

bool canRedo () const
bool canUndo () const

Private Attributes

QUuid const uuid
bool rewind
bool forward
bool invalid

Detailed Description

Class to uniformly encode a command's state.

It can only be used by derived classes

Definition at line 31 of file Command.hpp.

Constructor & Destructor Documentation

◆ state()

dbe::actions::state::state ( QUndoCommand * parent = nullptr,
QUuid const & uuid = 0 )
protected

Definition at line 419 of file Command.cpp.

420 : QUndoCommand(parent)
421 , uuid(uuid)
422 , rewind(true)
423 , forward(true)
424 , invalid(false)
425{
426}
QUuid const uuid
Definition Command.hpp:34

Member Function Documentation

◆ canRedo()

bool dbe::actions::state::canRedo ( ) const
private

Definition at line 481 of file Command.cpp.

482{
483 return redoable();
484}
bool redoable() const
Definition Command.cpp:469

◆ canUndo()

bool dbe::actions::state::canUndo ( ) const
private

Definition at line 487 of file Command.cpp.

488{
489 return undoable();
490}
bool undoable() const
Definition Command.cpp:463

◆ failed()

void dbe::actions::state::failed ( ) const

Definition at line 437 of file Command.cpp.

438{
439 invalid = true;
440 rewind = false;
441 forward = false;
442}

◆ isvalid()

bool dbe::actions::state::isvalid ( ) const

Definition at line 445 of file Command.cpp.

446{
447 return not invalid;
448}

◆ redoable()

bool dbe::actions::state::redoable ( ) const

Definition at line 469 of file Command.cpp.

470{
471 return forward and not invalid;
472}

◆ reload()

void dbe::actions::state::reload ( ) const

Definition at line 493 of file Command.cpp.

494{
495 // TODO evaluate: is this command that reloads the configuration object from the database really needed?
496}

◆ setredoable()

void dbe::actions::state::setredoable ( bool s = true) const

Definition at line 457 of file Command.cpp.

458{
459 forward = state;
460}
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:419

◆ setundoable()

void dbe::actions::state::setundoable ( bool s = true) const

Definition at line 451 of file Command.cpp.

452{
453 rewind = state;
454}

◆ source()

QUuid const & dbe::actions::state::source ( ) const

Definition at line 475 of file Command.cpp.

476{
477 return uuid;
478}

◆ toggle()

void dbe::actions::state::toggle ( )

Definition at line 429 of file Command.cpp.

430{
431 invalid = not invalid;
432 rewind = not rewind;
433 forward = not forward;
434}

◆ undoable()

bool dbe::actions::state::undoable ( ) const

Definition at line 463 of file Command.cpp.

464{
465 return rewind and not invalid;
466}

Member Data Documentation

◆ forward

bool dbe::actions::state::forward
mutableprivate

Definition at line 36 of file Command.hpp.

◆ invalid

bool dbe::actions::state::invalid
mutableprivate

Definition at line 37 of file Command.hpp.

◆ rewind

bool dbe::actions::state::rewind
mutableprivate

Definition at line 35 of file Command.hpp.

◆ uuid

QUuid const dbe::actions::state::uuid
private

Definition at line 34 of file Command.hpp.


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