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 28 of file Command.hpp.

Constructor & Destructor Documentation

◆ state()

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

Definition at line 520 of file Command.cpp.

521 : QUndoCommand ( parent ),
522 uuid ( uuid ),
523 rewind ( true ),
524 forward ( true ),
525 invalid ( false )
526{
527}
QUuid const uuid
Definition Command.hpp:32

Member Function Documentation

◆ canRedo()

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

Definition at line 573 of file Command.cpp.

574{
575 return redoable();
576}
bool redoable() const
Definition Command.cpp:563

◆ canUndo()

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

Definition at line 578 of file Command.cpp.

579{
580 return undoable();
581}
bool undoable() const
Definition Command.cpp:558

◆ failed()

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

Definition at line 536 of file Command.cpp.

537{
538 invalid = true;
539 rewind = false;
540 forward = false;
541}

◆ isvalid()

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

Definition at line 543 of file Command.cpp.

544{
545 return not invalid;
546}

◆ redoable()

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

Definition at line 563 of file Command.cpp.

564{
565 return forward and not invalid;
566}

◆ reload()

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

Definition at line 583 of file Command.cpp.

584{
585 // TODO evaluate: is this command that reloads the configuration object from the database really needed?
586}

◆ setredoable()

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

Definition at line 553 of file Command.cpp.

554{
555 forward = state;
556}
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:520

◆ setundoable()

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

Definition at line 548 of file Command.cpp.

549{
550 rewind = state;
551}

◆ source()

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

Definition at line 568 of file Command.cpp.

569{
570 return uuid;
571}

◆ toggle()

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

Definition at line 529 of file Command.cpp.

530{
531 invalid = not invalid;
532 rewind = not rewind;
533 forward = not forward;
534}

◆ undoable()

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

Definition at line 558 of file Command.cpp.

559{
560 return rewind and not invalid;
561}

Member Data Documentation

◆ forward

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

Definition at line 34 of file Command.hpp.

◆ invalid

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

Definition at line 35 of file Command.hpp.

◆ rewind

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

Definition at line 33 of file Command.hpp.

◆ uuid

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

Definition at line 32 of file Command.hpp.


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