/*========================================================================= Library: CTK Copyright (c) Kitware Inc. All rights reserved. Distributed under a BSD License. See LICENSE.txt file. This software is distributed "AS IS" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #ifndef __ctkAbstractObjectFactory_tpp #define __ctkAbstractObjectFactory_tpp // CTK includes #include "ctkAbstractObjectFactory.h" // QT includes #include //---------------------------------------------------------------------------- template ctkFactoryObjectItem::ctkFactoryObjectItem(const QString& _key) :ctkAbstractFactoryItem(_key) { } //---------------------------------------------------------------------------- template bool ctkFactoryObjectItem::load() { this->instantiateObjectFunc = &instantiateObject; return true; } //---------------------------------------------------------------------------- template BaseClassType* ctkFactoryObjectItem::instanciator() { return this->instantiateObjectFunc(); } //---------------------------------------------------------------------------- template ctkAbstractObjectFactory::ctkAbstractObjectFactory() { } //---------------------------------------------------------------------------- template ctkAbstractObjectFactory::~ctkAbstractObjectFactory() { } //----------------------------------------------------------------------------- template template bool ctkAbstractObjectFactory::registerObject(const QString& key) { // Check if already registered if (this->item(key)) { return false; } QSharedPointer > objectItem = QSharedPointer >( new ctkFactoryObjectItem(key) ); return this->registerItem(objectItem); } #endif