|
template<class D > |
D & | add (const K &key) |
| Adds class D as an internal instance. More...
|
|
template<class D > |
D & | add () |
|
template<class D > |
D & | addExternal (const D &entry, const K &key) |
| Adds class D using a copy constructor on an external instance. More...
|
|
bool | has (const K &key) const |
| Check if a cloner is defined for this key.
|
|
T & | clone (const K &key) const |
| Return a copy of the base instance.
|
|
const T & | get (const K &key) const |
| Returns the base instance.
|
|
T & | get (const K &key) |
| Returns the base instance.
|
|
template<class D > |
map_t::const_iterator | get () const |
| Returns a map entry: pair<Key,D *>()
|
|
cloner_t & | getCloner (const K &key) const |
| Return the internal static entry.
|
|
const map_t & | getMap () const |
|
virtual const std::string & | resolve (const K &key) const |
|
void | toStream (std::ostream &ostr=std::cout) const |
|
key_set_t & | getKeys () |
|
template<class T, class K = std::string>
class drain::Bank< T, K >
A single entry for each class D derived from T can be stored. The that \i base entry, any number of entries can be cloned. The cloned entries are of type D, yet accessible only through a reference of base class T .
- Template Parameters
-
T | - value type (base type for cloning) |
K | - key type |
An entry may have several keys. Single-char keys (aliases) are provided by SuperBank
Adds class D as an internal instance.
For each class D, a single static instance is created.
It is allowed to adding a class repeatedly with different keys.
Changing static to external instance and vice versa causes a warning.
D& addExternal |
( |
const D & |
entry, |
|
|
const K & |
key |
|
) |
| |
|
inline |
Adds class D using a copy constructor on an external instance.
For each class D, a single static instance is created.
It is allowed to adding a class repeatedly with different keys.
Changing static to external instance and vice versa causes a warning. Changing external instances is allowed.