chalk

#include <kis_generic_registry.h>

Public Member Functions

void add (_T item)
 
void add (KisID id, _T item)
 
_T remove (const KisID &name)
 
_T remove (const TQString &id)
 
_T get (const KisID &name) const
 
_T get (const TQString &id) const
 
bool exists (const KisID &id) const
 
bool exists (const TQString &id) const
 
bool search (const TQString &t, KisID &result) const
 
KisIDList listKeys () const
 

Protected Types

typedef std::map< KisID, _T > storageMap
 

Protected Member Functions

 KisGenericRegistry (const KisGenericRegistry &)
 
KisGenericRegistry operator= (const KisGenericRegistry &)
 

Protected Attributes

storageMap m_storage
 

Detailed Description

template<typename _T>
class KisGenericRegistry< _T >

Base class for registry objects in Chalk.

Chalk registries contain resources such as filters, tools or colorspaces.

Items are mapped by KisID. A KisID is the combination of a non-localized string that can be used in files and a user-visible, translated string that can be used in the user interface.

Definition at line 39 of file kis_generic_registry.h.

Member Typedef Documentation

◆ storageMap

template<typename _T >
typedef std::map<KisID, _T> KisGenericRegistry< _T >::storageMap
protected

Definition at line 41 of file kis_generic_registry.h.

Constructor & Destructor Documentation

◆ KisGenericRegistry() [1/2]

template<typename _T >
KisGenericRegistry< _T >::KisGenericRegistry ( )
inline

Definition at line 43 of file kis_generic_registry.h.

◆ ~KisGenericRegistry()

template<typename _T >
virtual KisGenericRegistry< _T >::~KisGenericRegistry ( )
inlinevirtual

Definition at line 44 of file kis_generic_registry.h.

◆ KisGenericRegistry() [2/2]

template<typename _T >
KisGenericRegistry< _T >::KisGenericRegistry ( const KisGenericRegistry< _T > &  )
inlineprotected

Definition at line 161 of file kis_generic_registry.h.

Member Function Documentation

◆ add() [1/2]

template<typename _T >
void KisGenericRegistry< _T >::add ( _T  item)
inline

add an object to the registry

Parameters
itemthe item to add (NOTE: _T must have an KisID id() function)

Definition at line 51 of file kis_generic_registry.h.

◆ add() [2/2]

template<typename _T >
void KisGenericRegistry< _T >::add ( KisID  id,
_T  item 
)
inline

add an object to the registry

Parameters
idthe id of the object
itemthe item

Definition at line 60 of file kis_generic_registry.h.

◆ exists() [1/2]

template<typename _T >
bool KisGenericRegistry< _T >::exists ( const KisID &  id) const
inline
Parameters
id
Returns
true if there is an object corresponding to id

Definition at line 115 of file kis_generic_registry.h.

◆ exists() [2/2]

template<typename _T >
bool KisGenericRegistry< _T >::exists ( const TQString &  id) const
inline

Definition at line 121 of file kis_generic_registry.h.

◆ get() [1/2]

template<typename _T >
_T KisGenericRegistry< _T >::get ( const KisID &  name) const
inline

This function allow to get an object from its KisID.

Parameters
namethe KisID of the object
Returns
_T the object

Definition at line 92 of file kis_generic_registry.h.

◆ get() [2/2]

template<typename _T >
_T KisGenericRegistry< _T >::get ( const TQString &  id) const
inline

Get a single entry based on the identifying part of KisID, not the the descriptive part.

Definition at line 106 of file kis_generic_registry.h.

◆ listKeys()

template<typename _T >
KisIDList KisGenericRegistry< _T >::listKeys ( ) const
inline

This function return a list of all the keys.

Definition at line 147 of file kis_generic_registry.h.

◆ operator=()

template<typename _T >
KisGenericRegistry KisGenericRegistry< _T >::operator= ( const KisGenericRegistry< _T > &  )
inlineprotected

Definition at line 162 of file kis_generic_registry.h.

◆ remove() [1/2]

template<typename _T >
_T KisGenericRegistry< _T >::remove ( const KisID &  name)
inline

This function remove an item from the registry.

Returns
the object which have been remove from the registry and which can be safely delete

Definition at line 68 of file kis_generic_registry.h.

◆ remove() [2/2]

template<typename _T >
_T KisGenericRegistry< _T >::remove ( const TQString &  id)
inline

This function remove an item from the registry.

Parameters
idthe identifiant of the object
Returns
the object which have been remove from the registry and which can be safely delete

Definition at line 83 of file kis_generic_registry.h.

◆ search()

template<typename _T >
bool KisGenericRegistry< _T >::search ( const TQString &  t,
KisID &  result 
) const
inline

This function allow to search a KisID from the name.

Parameters
tthe name to search
resultThe result is filled in this variable
Returns
true if the search has been successfull, false otherwise

Definition at line 131 of file kis_generic_registry.h.

Member Data Documentation

◆ m_storage

template<typename _T >
storageMap KisGenericRegistry< _T >::m_storage
protected

Definition at line 163 of file kis_generic_registry.h.


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