BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelView::AbstractItemCommand::AbstractItemCommandImpl Struct Reference
Collaboration diagram for ModelView::AbstractItemCommand::AbstractItemCommandImpl:
[legend]

Public Types

enum class  Status
 

Public Member Functions

 AbstractItemCommandImpl (AbstractItemCommand *parent)
 
bool can_execute () const
 
bool can_undo () const
 
void set_after_execute ()
 
void set_after_undo ()
 

Public Attributes

bool m_isObsolete {false}
 
SessionModelm_model {nullptr}
 
CommandResult m_result
 
AbstractItemCommandm_self {nullptr}
 
Status m_status {Status::initial}
 
std::string m_text
 

Detailed Description

Definition at line 24 of file abstractitemcommand.cpp.

Member Enumeration Documentation

◆ Status

Definition at line 25 of file abstractitemcommand.cpp.

25 { initial, after_execute, after_undo };

Constructor & Destructor Documentation

◆ AbstractItemCommandImpl()

ModelView::AbstractItemCommand::AbstractItemCommandImpl::AbstractItemCommandImpl ( AbstractItemCommand parent)
inline

Definition at line 32 of file abstractitemcommand.cpp.

Member Function Documentation

◆ can_execute()

bool ModelView::AbstractItemCommand::AbstractItemCommandImpl::can_execute ( ) const
inline

◆ can_undo()

bool ModelView::AbstractItemCommand::AbstractItemCommandImpl::can_undo ( ) const
inline

Definition at line 37 of file abstractitemcommand.cpp.

37 { return m_status == Status::after_execute && !m_self->isObsolete(); }
bool isObsolete() const
Returns whether the command is obsolete (which means that it shouldn't be kept in the stack).

References ModelView::AbstractItemCommand::isObsolete(), ModelView::AbstractItemCommand::AbstractItemCommandImpl::m_self, and ModelView::AbstractItemCommand::AbstractItemCommandImpl::m_status.

Here is the call graph for this function:

◆ set_after_execute()

void ModelView::AbstractItemCommand::AbstractItemCommandImpl::set_after_execute ( )
inline

Definition at line 34 of file abstractitemcommand.cpp.

34 { m_status = Status::after_execute; }

References ModelView::AbstractItemCommand::AbstractItemCommandImpl::m_status.

◆ set_after_undo()

void ModelView::AbstractItemCommand::AbstractItemCommandImpl::set_after_undo ( )
inline

Definition at line 35 of file abstractitemcommand.cpp.

35 { m_status = Status::after_undo; }

References ModelView::AbstractItemCommand::AbstractItemCommandImpl::m_status.

Member Data Documentation

◆ m_isObsolete

bool ModelView::AbstractItemCommand::AbstractItemCommandImpl::m_isObsolete {false}

Definition at line 26 of file abstractitemcommand.cpp.

◆ m_model

SessionModel* ModelView::AbstractItemCommand::AbstractItemCommandImpl::m_model {nullptr}

Definition at line 29 of file abstractitemcommand.cpp.

◆ m_result

CommandResult ModelView::AbstractItemCommand::AbstractItemCommandImpl::m_result

Definition at line 31 of file abstractitemcommand.cpp.

◆ m_self

AbstractItemCommand* ModelView::AbstractItemCommand::AbstractItemCommandImpl::m_self {nullptr}

◆ m_status

◆ m_text

std::string ModelView::AbstractItemCommand::AbstractItemCommandImpl::m_text

Definition at line 27 of file abstractitemcommand.cpp.


The documentation for this struct was generated from the following file: