Public Types | Public Member Functions | Protected Attributes | List of all members
Registry< T > Class Template Reference

A container for storing global objects like functors, operators or commands. Supports aliases. More...

#include <Registry.h>

Collaboration diagram for Registry< T >:
Collaboration graph
[legend]

Public Types

typedef std::map< std::string, T & > map_t
 

Public Member Functions

 Registry ()
 TODO: reference not recommended.
 
virtual void add (T &r, const std::string &key, char alias=0)
 Adds entry of (base) class T to current section of registry.
 
bool has (const std::string &key) const
 Queries whether a command has been added.
 
char getAlias (const std::string &key) const
 Returns a single-letter abbreviation of a command.
 
const std::string & getKey (char alias) const
 Given a single-letter abbreviation, return the command name.
 
T & get (const std::string &name) const
 Given a single-letter abbreviation or full command name, returns the command object.
 
map_t & getMap ()
 Returns the actual map containig the entries.
 
const map_t & getMap () const
 Returns the actual map containig the entries.
 
const map_t::const_iterator find (const std::string &name) const
 Like find(), but handles aliases.
 
map_t::iterator find (const std::string &name)
 Like find(), but handles aliases.
 
const drain::Dictionary< char, std::string > & getAliases () const
 

Protected Attributes

map_t entryMap
 
drain::Dictionary< char, std::string > aliasesNew
 

Detailed Description

template<class T>
class drain::Registry< T >

A container for storing global objects like functors, operators or commands. Supports aliases.


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