CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Loading...
Searching...
No Matches
Libs
Core
ctkAbstractPluginFactory.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Library: CTK
4
5
Copyright (c) Kitware Inc.
6
7
Licensed under the Apache License, Version 2.0 (the "License");
8
you may not use this file except in compliance with the License.
9
You may obtain a copy of the License at
10
11
http://www.apache.org/licenses/LICENSE-2.0.txt
12
13
Unless required by applicable law or agreed to in writing, software
14
distributed under the License is distributed on an "AS IS" BASIS,
15
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
See the License for the specific language governing permissions and
17
limitations under the License.
18
19
=========================================================================*/
20
21
#ifndef __ctkAbstractPluginFactory_h
22
#define __ctkAbstractPluginFactory_h
23
24
// Qt includes
25
#include <QPluginLoader>
26
#include <QFileInfo>
27
28
// CTK includes
29
#include "
ctkAbstractFileBasedFactory.h
"
30
31
//----------------------------------------------------------------------------
33
template
<
typename
BaseClassType>
34
class
ctkFactoryPluginItem
:
public
ctkAbstractFactoryFileBasedItem
<BaseClassType>
35
{
36
public
:
37
virtual
bool
load
();
38
virtual
QString
loadErrorString
()
const
;
39
40
protected
:
41
virtual
BaseClassType*
instanciator
();
42
43
private
:
44
QPluginLoader Loader;
45
};
46
47
//----------------------------------------------------------------------------
49
template
<
typename
BaseClassType>
50
class
ctkAbstractPluginFactory
:
public
ctkAbstractFileBasedFactory
<BaseClassType>
51
{
52
protected
:
53
virtual
bool
isValidFile
(
const
QFileInfo& file)
const
;
54
virtual
ctkAbstractFactoryItem<BaseClassType>
*
createFactoryFileBasedItem
();
55
};
56
57
#include "ctkAbstractPluginFactory.tpp"
58
59
#endif
ctkAbstractFactoryFileBasedItem
Definition
ctkAbstractFileBasedFactory.h:36
ctkAbstractFactoryItem
Definition
ctkAbstractFactory.h:43
ctkAbstractFileBasedFactory
Definition
ctkAbstractFileBasedFactory.h:50
ctkAbstractPluginFactory
Definition
ctkAbstractPluginFactory.h:51
ctkAbstractPluginFactory::createFactoryFileBasedItem
virtual ctkAbstractFactoryItem< BaseClassType > * createFactoryFileBasedItem()
ctkAbstractPluginFactory::isValidFile
virtual bool isValidFile(const QFileInfo &file) const
ctkFactoryPluginItem
Definition
ctkAbstractPluginFactory.h:35
ctkFactoryPluginItem::loadErrorString
virtual QString loadErrorString() const
ctkFactoryPluginItem::load
virtual bool load()
ctkFactoryPluginItem::instanciator
virtual BaseClassType * instanciator()
Must be reimplemented in subclasses to instanciate a BaseClassType*.
ctkAbstractFileBasedFactory.h
Generated on Wed Jul 19 2023 00:00:00 for CTK by
1.9.8