Audacity  2.2.0
CommandDirectory Class Reference

Allows registration and lookup (by name) of command types. More...

#include <CommandDirectory.h>

Public Member Functions

 ~CommandDirectory ()
CommandTypeLookUp (const wxString &cmdName) const
void AddCommand (movable_ptr< CommandType > &&type)
 Register a type of command with the directory. More...

Static Public Member Functions

static CommandDirectoryGet ()
 Get a pointer to the singleton instance. More...

Private Member Functions

 CommandDirectory ()

Private Attributes

CommandMap mCmdMap

Static Private Attributes

static std::unique_ptr
< CommandDirectory

Detailed Description

Allows registration and lookup (by name) of command types.

A singleton. This fulfills a similar purpose to CommandManager, but for general Commands rather than menu items. Eventually they could be unified but for now they are kept separate to make things simpler.

Constructor & Destructor Documentation

CommandDirectory::~CommandDirectory ( )
CommandDirectory::CommandDirectory ( )

References AddCommand().

Referenced by Get().

Member Function Documentation

void CommandDirectory::AddCommand ( movable_ptr< CommandType > &&  type)

Register a type of command with the directory.

References mCmdMap.

Referenced by CommandDirectory().

CommandDirectory * CommandDirectory::Get ( )
CommandType * CommandDirectory::LookUp ( const wxString &  cmdName) const

If a command with the given name has been registered in the directory, return a pointer to the factory for commands of that type. Otherwise return NULL.

References mCmdMap.

Referenced by HelpCommand::Apply(), CommandBuilder::BuildCommand(), ScreenFrame::CreateCommand(), and AudacityProject::SafeDisplayStatusMessage().

Member Data Documentation

CommandMap CommandDirectory::mCmdMap

Referenced by AddCommand(), and LookUp().

std::unique_ptr< CommandDirectory > CommandDirectory::mInstance

Referenced by Get().

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