Audacity  2.2.0
CommandImplementation Class Reference

is derived from Command. It validates and applies the command. CommandImplementation::Apply() is overloaded in classes derived from it. More...

#include <Command.h>

Inheritance diagram for CommandImplementation:
Command BatchEvalCommand CompareAudioCommand ExecMenuCommand ExportCommand GetAllMenuCommands GetPreferenceCommand GetProjectInfoCommand GetTrackInfoCommand HelpCommand ImportCommand MessageCommand OpenProjectCommand SaveProjectCommand ScreenshotCommand SelectCommand SetPreferenceCommand SetProjectInfoCommand SetTrackInfoCommand

Public Member Functions

void Progress (double completed)
 
void Status (const wxString &status) override
 
void Error (const wxString &message) override
 
 CommandImplementation (CommandType &type, std::unique_ptr< CommandOutputTarget > &&output)
 
virtual ~CommandImplementation ()
 
wxString GetName ()
 An instance method for getting the command name (for consistency) More...
 
CommandSignatureGetSignature ()
 Get the signature of the command. More...
 
bool SetParameter (const wxString &paramName, const wxVariant &paramValue)
 
bool Apply (CommandExecutionContext context) override
 
- Public Member Functions inherited from Command
virtual ~Command ()
 

Protected Member Functions

void TypeCheck (const wxString &typeName, const wxString &paramName, const wxVariant &param)
 
void CheckParam (const wxString &paramName)
 
bool GetBool (const wxString &paramName)
 
long GetLong (const wxString &paramName)
 
double GetDouble (const wxString &paramName)
 
wxString GetString (const wxString &paramName)
 

Protected Attributes

std::unique_ptr
< CommandOutputTarget
mOutput
 

Private Member Functions

bool Valid (const wxString &paramName, const wxVariant &paramValue)
 

Private Attributes

CommandTypemType
 
ParamValueMap mParams
 

Detailed Description

is derived from Command. It validates and applies the command. CommandImplementation::Apply() is overloaded in classes derived from it.

Constructor & Destructor Documentation

CommandImplementation::CommandImplementation ( CommandType type,
std::unique_ptr< CommandOutputTarget > &&  output 
)

Constructor should not be called directly; only by a factory which ensures name and params are set appropriately for the command.

References mOutput.

CommandImplementation::~CommandImplementation ( )
virtual

Member Function Documentation

void CommandImplementation::CheckParam ( const wxString &  paramName)
protected

References GetName(), and mParams.

Referenced by GetBool(), GetDouble(), GetLong(), and GetString().

bool CommandImplementation::GetBool ( const wxString &  paramName)
protected
double CommandImplementation::GetDouble ( const wxString &  paramName)
protected
long CommandImplementation::GetLong ( const wxString &  paramName)
protected
wxString CommandImplementation::GetName ( )
virtual

An instance method for getting the command name (for consistency)

Get the name of the command.

Implements Command.

References CommandType::GetName(), and mType.

Referenced by CheckParam(), SetParameter(), and TypeCheck().

CommandSignature & CommandImplementation::GetSignature ( )
virtual

Get the signature of the command.

Implements Command.

References CommandType::GetSignature(), and mType.

void CommandImplementation::Progress ( double  completed)
virtual

Implements Command.

References mOutput.

Referenced by CompareAudioCommand::Apply().

bool CommandImplementation::SetParameter ( const wxString &  paramName,
const wxVariant &  paramValue 
)
virtual

Attempt to one of the command's parameters to a particular value. (Note: wxVariant is reference counted)

Reimplemented from Command.

References Error(), Validator::GetConverted(), Validator::GetDescription(), GetName(), CommandType::GetSignature(), CommandSignature::GetValidator(), mParams, mType, and Validator::Validate().

void CommandImplementation::TypeCheck ( const wxString &  typeName,
const wxString &  paramName,
const wxVariant &  param 
)
protected

References GetName().

Referenced by GetBool(), GetDouble(), GetLong(), and GetString().

bool CommandImplementation::Valid ( const wxString &  paramName,
const wxVariant &  paramValue 
)
private

Using the command signature, looks up a possible parameter value and checks whether it passes the validator.

Member Data Documentation

std::unique_ptr<CommandOutputTarget> CommandImplementation::mOutput
protected
ParamValueMap CommandImplementation::mParams
private
CommandType& CommandImplementation::mType
private

Referenced by GetName(), GetSignature(), and SetParameter().


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