SDFormat Editor
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GenericCommand Class Reference

Executes a given function handle. More...

#include <GenericCommand.h>

Inheritance diagram for GenericCommand:
Inheritance graph
Collaboration diagram for GenericCommand:
Collaboration graph

Public Member Functions

 GenericCommand (std::function< void()> function_handle)
 Constructor for generic function call command objects.
 

Private Member Functions

bool Execute () override
 Implementation of interface method.
 
bool ExecuteUndo () override
 Implementation of interface method.
 
bool ExecuteRedo () override
 Implementation of interface method.
 
bool IsUndoable () override
 Implementation of interface method.
 
bool IsRedoable () override
 Implementation of interface method.
 
bool IsThreaded (bool &prevent_user_input) override
 Implementation of interface method.
 
bool ChangesProgramStateIrreversibly () override
 Implementation of interface method.
 

Private Attributes

std::function< void()> function_handle
 Function pointer to hold the command function.
 

Detailed Description

Executes a given function handle.

Constructor & Destructor Documentation

◆ GenericCommand()

GenericCommand::GenericCommand ( std::function< void()>  function_handle)

Constructor for generic function call command objects.

Parameters
[in]function_pointerfunction pointer to hold the command function

Member Function Documentation

◆ ChangesProgramStateIrreversibly()

bool GenericCommand::ChangesProgramStateIrreversibly ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Always false

Implements CommandI.

◆ Execute()

bool GenericCommand::Execute ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Always true. Executes the given function handle.

Implements CommandI.

◆ ExecuteRedo()

bool GenericCommand::ExecuteRedo ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Always false

Implements CommandI.

◆ ExecuteUndo()

bool GenericCommand::ExecuteUndo ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Always false

Implements CommandI.

◆ IsRedoable()

bool GenericCommand::IsRedoable ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Always false

Implements CommandI.

◆ IsThreaded()

bool GenericCommand::IsThreaded ( bool &  prevent_user_input)
overrideprivatevirtual

Implementation of interface method.

Parameters
[out]prevent_user_inputindicates if user input should be prevented if this happens to be a threaded command
Returns
Always false

Implements CommandI.

◆ IsUndoable()

bool GenericCommand::IsUndoable ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Always false

Implements CommandI.


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