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

Constructor & Destructor Documentation

◆ state()

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

Definition at line 525 of file Command.cpp.

526 : QUndoCommand ( parent ),
527 uuid ( uuid ),
528 rewind ( true ),
529 forward ( true ),
530 invalid ( false )
531{
532}
QUuid const uuid
Definition Command.hpp:37

Member Function Documentation

◆ canRedo()

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

Definition at line 578 of file Command.cpp.

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

◆ canUndo()

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

Definition at line 583 of file Command.cpp.

584{
585 return undoable();
586}
bool undoable() const
Definition Command.cpp:563

◆ failed()

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

Definition at line 541 of file Command.cpp.

542{
543 invalid = true;
544 rewind = false;
545 forward = false;
546}

◆ isvalid()

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

Definition at line 548 of file Command.cpp.

549{
550 return not invalid;
551}

◆ redoable()

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

Definition at line 568 of file Command.cpp.

569{
570 return forward and not invalid;
571}

◆ reload()

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

Definition at line 588 of file Command.cpp.

589{
590 // TODO evaluate: is this command that reloads the configuration object from the database really needed?
591}

◆ setredoable()

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

Definition at line 558 of file Command.cpp.

559{
560 forward = state;
561}
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition Command.cpp:525

◆ setundoable()

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

Definition at line 553 of file Command.cpp.

554{
555 rewind = state;
556}

◆ source()

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

Definition at line 573 of file Command.cpp.

574{
575 return uuid;
576}

◆ toggle()

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

Definition at line 534 of file Command.cpp.

535{
536 invalid = not invalid;
537 rewind = not rewind;
538 forward = not forward;
539}

◆ undoable()

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

Definition at line 563 of file Command.cpp.

564{
565 return rewind and not invalid;
566}

Member Data Documentation

◆ forward

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

Definition at line 39 of file Command.hpp.

◆ invalid

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

Definition at line 40 of file Command.hpp.

◆ rewind

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

Definition at line 38 of file Command.hpp.

◆ uuid

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

Definition at line 37 of file Command.hpp.


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