Audacity  2.2.0
CommandDirectory.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 ******************************************************************//*******************************************************************/
22 
23 #ifndef __COMMANDDIRECTORY__
24 #define __COMMANDDIRECTORY__
25 
26 #include "../MemoryX.h"
27 #include "CommandMisc.h"
28 #include "CommandType.h"
29 
30 class Command;
32 
34 {
35 private:
36  static std::unique_ptr<CommandDirectory> mInstance;
38 public:
40 
44  CommandType *LookUp(const wxString &cmdName) const;
45 
48 
50  static CommandDirectory *Get();
51 
52 private:
54 };
55 
56 #endif /* End of include guard: __COMMANDDIRECTORY__ */
static CommandDirectory * Get()
Get a pointer to the singleton instance.
Definition: CommandDirectory.cpp:89
std::unique_ptr< T > movable_ptr
Definition: MemoryX.h:683
static std::unique_ptr< CommandDirectory > mInstance
Definition: CommandDirectory.h:36
Contains declarations for CommandType class.
Base class which encapsulates a process.
Definition: Command.h:60
Allows registration and lookup (by name) of command types.
Definition: CommandDirectory.h:33
CommandType * LookUp(const wxString &cmdName) const
Definition: CommandDirectory.cpp:68
Base class for containing data common to all commands of a given type. Also acts as a factory...
Definition: CommandType.h:29
CommandDirectory()
Definition: CommandDirectory.cpp:38
CommandMap mCmdMap
Definition: CommandDirectory.h:37
Definition: CommandTargets.h:186
std::map< wxString, movable_ptr< CommandType > > CommandMap
Definition: CommandMisc.h:35
void AddCommand(movable_ptr< CommandType > &&type)
Register a type of command with the directory.
Definition: CommandDirectory.cpp:78
~CommandDirectory()
Definition: CommandDirectory.cpp:64