Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CommandSignature Class Reference

Class that maps parameter names to default values and validators. More...

#include <CommandSignature.h>

Collaboration diagram for CommandSignature:
[legend]

Public Member Functions

 CommandSignature ()
 
 ~CommandSignature ()
 
void AddParameter (const wxString &name, const wxVariant &dft, std::unique_ptr< Validator > &&valid)
 
ParamValueMap GetDefaults () const
 
ValidatorGetValidator (const wxString &paramName)
 

Private Member Functions

 CommandSignature (const CommandSignature &)=delete
 
CommandSignatureoperator= (const CommandSignature &)=delete
 

Private Attributes

ParamValueMap mDefaults
 
ValidatorMap mValidators
 

Detailed Description

Class that maps parameter names to default values and validators.

Definition at line 28 of file CommandSignature.h.

Constructor & Destructor Documentation

◆ CommandSignature() [1/2]

CommandSignature::CommandSignature ( const CommandSignature )
privatedelete

◆ CommandSignature() [2/2]

CommandSignature::CommandSignature ( )
explicitdefault

◆ ~CommandSignature()

CommandSignature::~CommandSignature ( )

Definition at line 21 of file CommandSignature.cpp.

22{
23}

Member Function Documentation

◆ AddParameter()

void CommandSignature::AddParameter ( const wxString &  name,
const wxVariant &  dft,
std::unique_ptr< Validator > &&  valid 
)

Definition at line 25 of file CommandSignature.cpp.

28{
29 wxASSERT_MSG(valid->Validate(dft),
30 wxT("Invalid command signature: the default value of '")
31 + dft.MakeString()
32 + wxT("' for the '")
33 + name
34 + wxT("' parameter doesn't satisfy the provided validator.")
35 + wxT(" It should be ")
36 + valid->GetDescription()
37 + wxT("."));
38 mDefaults.insert(std::pair<wxString, wxVariant>(name, dft));
39 mValidators.insert(ValidatorMap::value_type(name, std::move(valid)));
40}
wxT("CloseDown"))
const TranslatableString name
Definition: Distortion.cpp:76
ParamValueMap mDefaults
ValidatorMap mValidators

References mDefaults, mValidators, name, and wxT().

Referenced by BatchEvalCommandType::BuildSignature().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDefaults()

ParamValueMap CommandSignature::GetDefaults ( ) const

Definition at line 42 of file CommandSignature.cpp.

43{
44 return mDefaults;
45}

References mDefaults.

Referenced by CommandBuilder::BuildCommand().

Here is the caller graph for this function:

◆ GetValidator()

Validator & CommandSignature::GetValidator ( const wxString &  paramName)

Definition at line 47 of file CommandSignature.cpp.

48{
49 wxASSERT(mValidators.find(paramName) != mValidators.end());
50 return *mValidators[paramName];
51}

References mValidators.

Referenced by CommandImplementation::SetParameter().

Here is the caller graph for this function:

◆ operator=()

CommandSignature & CommandSignature::operator= ( const CommandSignature )
privatedelete

Member Data Documentation

◆ mDefaults

ParamValueMap CommandSignature::mDefaults
private

Definition at line 31 of file CommandSignature.h.

Referenced by AddParameter(), and GetDefaults().

◆ mValidators

ValidatorMap CommandSignature::mValidators
private

Definition at line 32 of file CommandSignature.h.

Referenced by AddParameter(), and GetValidator().


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