Audacity  2.2.0
CommandImplementation Class Reference

#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

< CommandOutputTarget

Private Member Functions

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

Private Attributes

ParamValueMap mParams

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 ( )

Member Function Documentation

void CommandImplementation::CheckParam ( const wxString &  paramName)

References GetName(), and mParams.

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

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

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 ( )

Get the signature of the command.

Implements Command.

References CommandType::GetSignature(), and mType.

void CommandImplementation::Progress ( double  completed)

Implements Command.

References mOutput.

Referenced by CompareAudioCommand::Apply().

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

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 

References GetName().

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

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

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
ParamValueMap CommandImplementation::mParams
CommandType& CommandImplementation::mType

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

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