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 | Protected Member Functions | List of all members
ctkAbstractFileBasedFactory< BaseClassType > Class Template Reference

#include <Libs/Core/ctkAbstractFileBasedFactory.h>

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

Public Member Functions

virtual bool isValidFile (const QFileInfo &file) const
 
QString itemKey (const QFileInfo &file) const
 
virtual QString path (const QString &key)
 Get path associated with the library identified by key. More...
 
QString registerFileItem (const QFileInfo &file)
 
- 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 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 ()
 

Protected Member Functions

virtual ctkAbstractFactoryItem< BaseClassType > * createFactoryFileBasedItem ()
 
virtual QString fileNameToKey (const QString &path) const
 
virtual void initItem (ctkAbstractFactoryItem< BaseClassType > *item)
 
void registerAllFileItems (const QStringList &directories)
 
bool registerFileItem (const QString &key, const QFileInfo &file)
 
- 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
 

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
 

Detailed Description

template<typename BaseClassType>
class ctkAbstractFileBasedFactory< BaseClassType >

Definition at line 49 of file ctkAbstractFileBasedFactory.h.

Member Function Documentation

◆ createFactoryFileBasedItem()

template<typename BaseClassType >
virtual ctkAbstractFactoryItem<BaseClassType>* ctkAbstractFileBasedFactory< BaseClassType >::createFactoryFileBasedItem ( )
protectedvirtual

◆ fileNameToKey()

template<typename BaseClassType >
virtual QString ctkAbstractFileBasedFactory< BaseClassType >::fileNameToKey ( const QString &  path) const
protectedvirtual

◆ initItem()

template<typename BaseClassType >
virtual void ctkAbstractFileBasedFactory< BaseClassType >::initItem ( ctkAbstractFactoryItem< BaseClassType > *  item)
protectedvirtual

◆ isValidFile()

template<typename BaseClassType >
virtual bool ctkAbstractFileBasedFactory< BaseClassType >::isValidFile ( const QFileInfo &  file) const
virtual

◆ itemKey()

template<typename BaseClassType >
QString ctkAbstractFileBasedFactory< BaseClassType >::itemKey ( const QFileInfo &  file) const

◆ path()

template<typename BaseClassType >
virtual QString ctkAbstractFileBasedFactory< BaseClassType >::path ( const QString &  key)
virtual

Get path associated with the library identified by key.

Reimplemented from ctkAbstractFactory< BaseClassType >.

◆ registerAllFileItems()

template<typename BaseClassType >
void ctkAbstractFileBasedFactory< BaseClassType >::registerAllFileItems ( const QStringList &  directories)
protected

◆ registerFileItem() [1/2]

template<typename BaseClassType >
QString ctkAbstractFileBasedFactory< BaseClassType >::registerFileItem ( const QFileInfo &  file)

Register the item and return the itemkey on success, otherwise return an empty string.

◆ registerFileItem() [2/2]

template<typename BaseClassType >
bool ctkAbstractFileBasedFactory< BaseClassType >::registerFileItem ( const QString &  key,
const QFileInfo &  file 
)
protected

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