Carousel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
TypeObjectsMap< TValue > Class Template Reference

This utility class is a dictionary, used to store anonymous object by a key. More...

#include <TypeObjectsMap.h>

Public Member Functions

TValue getInstance (const QString &key) const
 
TValue getInstance (const QString &key, const QString &tag) const
 
QStringList keys () const
 
QStringList keys (const QString &tag) const
 
void registerInstance (TValue instance, const QString &key)
 
void registerInstance (TValue instance, const QString &key, const QString &tag)
 
int size () const
 
TValue unregisterInstance (const QString &key, const QString &tag)
 

Detailed Description

template<typename TValue>
class TypeObjectsMap< TValue >

This utility class is a dictionary, used to store anonymous object by a key.

This class designed to store objects of anonymous type with unique keys. It is used in service locators and component extensions.

Member Function Documentation

template<typename TValue >
TValue TypeObjectsMap< TValue >::getInstance ( const QString &  key) const

Finds pointer associated with specified key and empty tag in inner objects dictionary.

Returns
The value corresponded with specified key if such found. Null pointer otherwise.
template<typename TValue >
TValue TypeObjectsMap< TValue >::getInstance ( const QString &  key,
const QString &  tag 
) const

Finds pointer associated with specified key and tag in inner objects dictionary.

Returns
The value corresponded with specified key if such found. Null pointer otherwise.
template<typename TValue>
void TypeObjectsMap< TValue >::registerInstance ( TValue  instance,
const QString &  key 
)

Registers a value with empty tag and specified key in inner objects dictionary.

template<typename TValue>
void TypeObjectsMap< TValue >::registerInstance ( TValue  instance,
const QString &  key,
const QString &  tag 
)

Registers a value with specified key and tag in inner objects dictionary.

template<typename TValue >
int TypeObjectsMap< TValue >::size ( ) const

Returns the amount of registered in map objects.

template<typename TValue >
TValue TypeObjectsMap< TValue >::unregisterInstance ( const QString &  key,
const QString &  tag 
)

Removes value with specified key and tag from the inner objects dictionary.

Returns
The raw pointer corresponded with specified key and tag if such found. Default value TValue() otherwise.
template<typename TValue >
QStringList TypeObjectsMap< TValue >::keys ( ) const

Returns all registered keys for instances;

template<typename TValue >
QStringList TypeObjectsMap< TValue >::keys ( const QString &  tag) const

Returns all registered with specified tag keys for instances;