dnai::commands::GenericCommand< Args > Class Template Reference

#include <genericcommand.h>

Inheritance diagram for dnai::commands::GenericCommand< Args >:
Inheritance graph
Collaboration diagram for dnai::commands::GenericCommand< Args >:
Collaboration graph

Protected Member Functions

void execute () const override
 Execute the command. More...
 
void executeSave () override
 Save current state of the command for the reverse unExcute() More...
 
void unExcute () const override
 Reverse the execute() function. More...
 
QString infos () const override
 Get display info for this command. More...
 
bool isSave () const override
 Is the command is in a save state. More...
 
- Protected Member Functions inherited from dnai::interfaces::ICommand
virtual ~ICommand ()=default
 

Private Member Functions

 GenericCommand (interfaces::IEditorModel *model, std::function< void(interfaces::IEditorModel *)> dofunc, std::function< void(interfaces::IEditorModel *)> undo, const QString &name, const bool save=false)
 

Private Attributes

interfaces::IEditorModelm_model
 
std::function< void(interfaces::IEditorModel *)> m_dofunc
 
std::function< void(interfaces::IEditorModel *)> m_undo
 

Additional Inherited Members

- Public Member Functions inherited from dnai::commands::Command
 Command (const QString &name, bool save=false)
 
const QString & name () const
 Get the command name. More...
 
- Protected Attributes inherited from dnai::commands::Command
const QString m_name
 
const bool m_save
 

Constructor & Destructor Documentation

template<class... Args>
dnai::commands::GenericCommand< Args >::GenericCommand ( interfaces::IEditorModel model,
std::function< void(interfaces::IEditorModel *)>  dofunc,
std::function< void(interfaces::IEditorModel *)>  undo,
const QString &  name,
const bool  save = false 
)
inlineprivate

Member Function Documentation

template<class... Args>
void dnai::commands::GenericCommand< Args >::execute ( ) const
inlineoverrideprotectedvirtual

Execute the command.

Reimplemented from dnai::commands::Command.

template<class... Args>
void dnai::commands::GenericCommand< Args >::executeSave ( )
inlineoverrideprotectedvirtual

Save current state of the command for the reverse unExcute()

Reimplemented from dnai::commands::Command.

template<class... Args>
QString dnai::commands::GenericCommand< Args >::infos ( ) const
inlineoverrideprotectedvirtual

Get display info for this command.

Returns
QString

Reimplemented from dnai::commands::Command.

template<class... Args>
bool dnai::commands::GenericCommand< Args >::isSave ( ) const
inlineoverrideprotectedvirtual

Is the command is in a save state.

Returns
bool

Reimplemented from dnai::commands::Command.

template<class... Args>
void dnai::commands::GenericCommand< Args >::unExcute ( ) const
inlineoverrideprotectedvirtual

Reverse the execute() function.

Reimplemented from dnai::commands::Command.

Member Data Documentation

template<class... Args>
std::function<void(interfaces::IEditorModel*)> dnai::commands::GenericCommand< Args >::m_dofunc
private
template<class... Args>
interfaces::IEditorModel* dnai::commands::GenericCommand< Args >::m_model
private
template<class... Args>
std::function<void(interfaces::IEditorModel*)> dnai::commands::GenericCommand< Args >::m_undo
private

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