19#ifndef _KIS_GENERIC_REGISTRY_H_
20#define _KIS_GENERIC_REGISTRY_H_
39class KisGenericRegistry {
41 typedef std::map<KisID, _T> storageMap;
43 KisGenericRegistry() { };
44 virtual ~KisGenericRegistry() { };
53 m_storage.insert( typename storageMap::value_type( item->id(), item) );
62 m_storage.insert( typename storageMap::value_type( id, item));
71 typename storageMap::iterator it = m_storage.find(name);
72 if (it != m_storage.end()) {
95 typename storageMap::const_iterator it = m_storage.find(name);
96 if (it != m_storage.end()) {
106 _T get( const TQString& id) const
117 typename storageMap::const_iterator it = m_storage.find( id);
118 return (it != m_storage.end());
121 bool exists( const TQString& id) const
133 for( typename storageMap::const_iterator it = m_storage.begin();
134 it != m_storage.end(); ++it)
136 if(it->first.name() == t)
150 typename storageMap::const_iterator it = m_storage.begin();
151 typename storageMap::const_iterator endit = m_storage.end();
154 list.append(it->first);
162 KisGenericRegistry operator=( const KisGenericRegistry&) { };
163 storageMap m_storage;
Base class for registry objects in Chalk.
void add(KisID id, _T item) add an object to the registry
_T remove(const KisID &name) This function remove an item from the registry.
KisIDList listKeys() const This function return a list of all the keys.
bool search(const TQString &t, KisID &result) const This function allow to search a KisID from the name.
bool exists(const KisID &id) const
_T get(const KisID &name) const This function allow to get an object from its KisID.
_T get(const TQString &id) const Get a single entry based on the identifying part of KisID, not the the descriptive part.
void add(_T item) add an object to the registry
_T remove(const TQString &id) This function remove an item from the registry.
Chalk has a large number of extensible resources.
|