~charon-developers/charon-core/trunk

« back to all changes in this revision

Viewing changes to src/PluginManagerInterface.h

  • Committer: jmgottfried
  • Date: 2010-03-16 15:18:38 UTC
  • Revision ID: svn-v4:7d56a235-2f8b-4627-957e-5f30cc86da59:charon-core/trunk:680
moved header files to seperate include directory

this makes e.g. Compile and Load test work even if charon-core is not yet installed
and gives a chance to get charon-meta working

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  This file is part of Charon.
2
 
 
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.
7
 
 
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.
12
 
 
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/>.
15
 
 */
16
 
/**
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>
21
 
 *
22
 
 * @date 20.08.2009
23
 
 */
24
 
#ifndef PLUGINMANAGERINTERFACE_H_
25
 
#define PLUGINMANAGERINTERFACE_H_
26
 
 
27
 
#include "ParameteredObject.h"
28
 
 
29
 
/**
30
 
 * Interface for a plugin manager.
31
 
 */
32
 
class PluginManagerInterface {
33
 
protected:
34
 
        /**
35
 
         * Saves currently existing instances
36
 
         */
37
 
        std::map<std::string, ParameteredObject *> objects;
38
 
public:
39
 
        /**
40
 
         * Default Constructor
41
 
         */
42
 
        PluginManagerInterface() {
43
 
 
44
 
        }
45
 
 
46
 
        /**
47
 
         * Returns an existing instance of a loaded plugin.
48
 
         *
49
 
         * @param instanceName Name of the instance
50
 
         * @return Pointer to the requested instance
51
 
         */
52
 
        virtual ParameteredObject
53
 
                        * getInstance(const std::string & instanceName) const = 0;
54
 
 
55
 
        /**
56
 
         * Returns a map containing linking the instance name to the existing
57
 
         * instances.
58
 
         *
59
 
         * @return Map containing all existing instances
60
 
         */
61
 
        virtual const std::map<std::string, ParameteredObject *> & getObjectList() const {
62
 
                return objects;
63
 
        }
64
 
 
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;
78
 
 
79
 
        /**
80
 
         * Default destructor
81
 
         */
82
 
        virtual ~PluginManagerInterface() {
83
 
 
84
 
        }
85
 
};
86
 
 
87
 
#endif /* PLUGINMANAGERINTERFACE_H_ */