Audacity  2.2.0
CommandType.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity - A Digital Audio Editor
4  Copyright 1999-2009 Audacity Team
5  License: wxwidgets
6 
7  Dan Horgan
8 
9 ******************************************************************//*******************************************************************/
15 
16 #ifndef __COMMANDTYPE__
17 #define __COMMANDTYPE__
18 
19 #include "CommandMisc.h"
20 #include "CommandSignature.h"
21 #include "../MemoryX.h"
22 
23 class Command;
24 using CommandHolder = std::shared_ptr<Command>;
26 class CommandSignature;
27 class wxString;
28 
29 class CommandType /* not final */
30 {
31 private:
32  wxString mName;
34 
35 public:
36  CommandType();
37  virtual ~CommandType();
38  const wxString &GetName();
40  wxString Describe();
41 
42  // Subclasses should override the following:
43  // =========================================
44 
45  // Return the name of the command type
46  virtual wxString BuildName() = 0;
47 
49  // names, validators and default values.
50  virtual void BuildSignature(CommandSignature &signature) = 0;
51 
52  // Create a command instance with the specified output target
53  virtual CommandHolder Create(std::unique_ptr<CommandOutputTarget> &&target) = 0;
54 };
55 
56 #endif /* End of include guard: __COMMANDTYPE__ */
virtual ~CommandType()
Definition: CommandType.cpp:30
virtual void BuildSignature(CommandSignature &signature)=0
Postcondition: signature is a 'signature' map containing parameter.
CommandType()
Definition: CommandType.cpp:26
const wxString & GetName()
Definition: CommandType.cpp:34
std::shared_ptr< Command > CommandHolder
Definition: AppCommandEvent.h:26
Maybe< CommandSignature > mSignature
Definition: CommandType.h:33
Base class which encapsulates a process.
Definition: Command.h:60
CommandSignature & GetSignature()
Definition: CommandType.cpp:41
Base class for containing data common to all commands of a given type. Also acts as a factory...
Definition: CommandType.h:29
Definition: CommandTargets.h:186
virtual CommandHolder Create(std::unique_ptr< CommandOutputTarget > &&target)=0
virtual wxString BuildName()=0
wxString mName
Definition: CommandType.h:32
wxString Describe()
Definition: CommandType.cpp:51
Class that maps parameter names to default values and validators.
Definition: CommandSignature.h:28
Declaration of CommandSignature class.