1
/* This file is part of Charon.
3
Charon is free software: you can redistribute it and/or modify
4
it under the terms of the GNU Lesser General Public License as published by
5
the Free Software Foundation, either version 3 of the License, or
6
(at your option) any later version.
8
Charon is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU Lesser General Public License for more details.
13
You should have received a copy of the GNU Lesser General Public License
14
along with Charon. If not, see <http://www.gnu.org/licenses/>.
17
* @file PluginManagerInterface.h
18
* Provides an interface for a plugin manager.
19
* @author <a href="mailto:bc002@ix.urz.uni-heidelberg.de">
20
* Cornelius Ratsch</a>
24
#ifndef PLUGINMANAGERINTERFACE_H_
25
#define PLUGINMANAGERINTERFACE_H_
27
#include "ParameteredObject.h"
30
* Interface for a plugin manager.
32
class PluginManagerInterface {
35
* Saves currently existing instances
37
std::map<std::string, ParameteredObject *> objects;
42
PluginManagerInterface() {
47
* Returns an existing instance of a loaded plugin.
49
* @param instanceName Name of the instance
50
* @return Pointer to the requested instance
52
virtual ParameteredObject
53
* getInstance(const std::string & instanceName) const = 0;
56
* Returns a map containing linking the instance name to the existing
59
* @return Map containing all existing instances
61
virtual const std::map<std::string, ParameteredObject *> & getObjectList() const {
65
/// Recurse into object list and find connected objects.
66
/// This is based on the content of the given ParameterFile,
67
/// i.e. the connected objects need not to exist really.
68
/// This is also independend of the existing connections of the
69
/// current object, it is only based on the connections saved
70
/// in the parameter file.
71
/// Nonexistent objects are created, so you have to make sure,
72
/// that the object factory is up and running.
73
/// The root object itself is also part of the connected component.
74
/// @param root Starting point for connected object search
75
/// @param pf ParameterFile to read connections from.
76
virtual std::set<std::string> getConnected(const std::string & root,
77
const ParameterFile & pf) const = 0;
82
virtual ~PluginManagerInterface() {
87
#endif /* PLUGINMANAGERINTERFACE_H_ */