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
ctkAbstractObjectFactory< BaseClassType > Class Template Reference

#include <Libs/Core/ctkAbstractObjectFactory.h>

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

Public Member Functions

 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 ctkAbstractObjectFactory< BaseClassType >

Definition at line 59 of file ctkAbstractObjectFactory.h.

Constructor & Destructor Documentation

◆ ctkAbstractObjectFactory()

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

Member Function Documentation

◆ registerObject()

template<typename BaseClassType >
template<typename ClassType >
bool ctkAbstractObjectFactory< BaseClassType >::registerObject ( const QString &  key)

Register an object in the factory.


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