CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Member Functions | List of all members
ctkAbstractQObjectFactory< BaseClassType > Class Template Reference

#include <Libs/Core/ctkAbstractQObjectFactory.h>

Inheritance diagram for ctkAbstractQObjectFactory< BaseClassType >:
Inheritance graph
[legend]
Collaboration diagram for ctkAbstractQObjectFactory< BaseClassType >:
Collaboration graph
[legend]

Public Member Functions

 ctkAbstractQObjectFactory ()
 Constructor/Desctructor. More...
 
virtual QString objectNameToKey (const QString &objectName)
 Return a name allowing to uniquely identify the QObject By default, it return objectName obtained using staticMetaObject.className() More...
 
template<typename ClassType >
bool registerQObject (QString &key)
 Register an object in the factory The parameter key passed by reference will be updated with the associated object name obtained using objectNameToKey(const QString&) More...
 
virtual ~ctkAbstractQObjectFactory ()
 
- Public Member Functions inherited from ctkAbstractObjectFactory< BaseClassType >
 ctkAbstractObjectFactory ()
 
template<typename ClassType >
bool registerObject (const QString &key)
 Register an object in the factory. More...
 
- Public Member Functions inherited from ctkAbstractFactory< BaseClassType >
 ctkAbstractFactory ()
 Constructor/Desctructor. More...
 
virtual BaseClassType * instance (const QString &itemKey)
 Return the instance associated with itemKey if any, otherwise return 0. More...
 
virtual BaseClassType * instantiate (const QString &itemKey)
 Create an instance of the object. The item corresponding to the key should have been registered before. More...
 
QStringList itemKeys () const
 Get list of all registered item keys. More...
 
virtual QString path (const QString &itemKey)
 Get path associated with the item identified by itemKey Should be overloaded in subclasse. More...
 
virtual void printAdditionalInfo ()
 
virtual void registerItems ()
 Register items with the factory Method provided for convenience - Should be overloaded in subclasse. More...
 
void setSharedItems (const QSharedPointer< HashType > &items)
 
void setVerbose (bool value)
 Enabled verbose output Warning and error message will be printed to standard outputs. More...
 
QSharedPointer< HashTypesharedItems ()
 
void uninstantiate (const QString &itemKey)
 Uninstanciate the object. Do nothing if the item given by the key has not be instantiated nor registered. More...
 
bool verbose () const
 
virtual ~ctkAbstractFactory ()
 

Additional Inherited Members

- Public Types inherited from ctkAbstractFactory< BaseClassType >
typedef QHash< QString, QSharedPointer< ctkAbstractFactoryItem< BaseClassType > > > HashType
 
- Protected Types inherited from ctkAbstractFactory< BaseClassType >
typedef HashType::const_iterator ConstIterator
 
typedef HashType::iterator Iterator
 
- Protected Member Functions inherited from ctkAbstractFactory< BaseClassType >
void displayStatusMessage (const QtMsgType &type, const QString &description, const QString &status, bool display)
 
ctkAbstractFactoryItem< BaseClassType > * item (const QString &itemKey) const
 Get a Factory item given its itemKey. Return 0 if any. More...
 
bool registerItem (const QString &key, const QSharedPointer< ctkAbstractFactoryItem< BaseClassType > > &item)
 Call the load method associated with the item. If succesfully loaded, add it to the internal map. More...
 
ctkAbstractFactoryItem< BaseClassType > * sharedItem (const QString &itemKey) const
 

Detailed Description

template<typename BaseClassType>
class ctkAbstractQObjectFactory< BaseClassType >

Definition at line 33 of file ctkAbstractQObjectFactory.h.

Constructor & Destructor Documentation

◆ ctkAbstractQObjectFactory()

template<typename BaseClassType >
ctkAbstractQObjectFactory< BaseClassType >::ctkAbstractQObjectFactory ( )
explicit

Constructor/Desctructor.

◆ ~ctkAbstractQObjectFactory()

template<typename BaseClassType >
virtual ctkAbstractQObjectFactory< BaseClassType >::~ctkAbstractQObjectFactory ( )
virtual

Member Function Documentation

◆ objectNameToKey()

template<typename BaseClassType >
virtual QString ctkAbstractQObjectFactory< BaseClassType >::objectNameToKey ( const QString &  objectName)
virtual

Return a name allowing to uniquely identify the QObject By default, it return objectName obtained using staticMetaObject.className()

◆ registerQObject()

template<typename BaseClassType >
template<typename ClassType >
bool ctkAbstractQObjectFactory< BaseClassType >::registerQObject ( QString &  key)

Register an object in the factory The parameter key passed by reference will be updated with the associated object name obtained using objectNameToKey(const QString&)


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