NEST  2.6.0,not_revisioned_source_dir@0
dynamicloader.h
Go to the documentation of this file.
1 /*
2  * dynamicloader.h
3  *
4  * This file is part of NEST.
5  *
6  * Copyright (C) 2004 The NEST Initiative
7  *
8  * NEST is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * NEST is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef DYNAMICLOADER_H
24 #define DYNAMICLOADER_H
25 
26 #include "config.h"
27 
28 // DynamicLoaderModule defined only if libltdl is available
29 
30 #ifdef HAVE_LIBLTDL
31 
32 #include "slimodule.h"
33 #include "slifunction.h"
34 
35 #include <vector>
36 
37 class DynModule;
38 
39 namespace nest
40 {
41 
42  // structure to store handles and pointers to modules
43  struct sDynModule;
44 
45  typedef std::vector<sDynModule> vecDynModules;
46 
47  typedef std::vector<DynModule*> vecLinkedModules;
48 
49  class Network;
50 
51 
59  {
60  public:
61 
64 
65  void init(SLIInterpreter *);
66 
67  const std::string commandstring(void) const;
68  const std::string name(void) const;
69 
70 
77  static int registerLinkedModule(DynModule *pModule);
78 
80 
81  public:
82 
84  {
85  public:
87 
88  private:
89  void execute(SLIInterpreter *) const;
90 
91  private:
94  };
95 
97  {
98  public:
100 
101  private:
102  void execute(SLIInterpreter *) const;
103 
104  private:
107 
108  };
109 
110 
111 
116 
117  private:
125 
126  // vector to store handles and pointers to dynamic modules
128 
131  };
132 
133 } // namespace
134 
135 #endif // HAVE_LIBLTDL
136 
137 #endif
void init(SLIInterpreter *)
Initialise the module.
Definition: dynamicloader.cpp:321
void execute(SLIInterpreter *) const
Definition: dynamicloader.cpp:143
static vecLinkedModules & getLinkedModules()
Provide access to the list of linked modules managed DynamicLoader.
Definition: dynamicloader.cpp:73
static int registerLinkedModule(DynModule *pModule)
This static member is called by the constructor of a loadable module that was linked at compile time ...
Definition: dynamicloader.cpp:354
~DynamicLoaderModule()
Definition: dynamicloader.cpp:96
Definition: slifunction.h:35
Network * pNet_
Definition: dynamicloader.h:129
LoadModuleFunction(Network *pNet, vecDynModules &dyn_modules)
Definition: dynamicloader.cpp:139
void execute(SLIInterpreter *) const
Definition: dynamicloader.cpp:257
Network * pNet_
Definition: dynamicloader.h:92
LoadModuleFunction loadmodule_function
Definition: dynamicloader.h:114
A class that associates names and tokens.
Definition: dict.h:45
UnloadModuleFunction(Network *pNet, vecDynModules &dyn_modules)
Definition: dynamicloader.cpp:254
std::vector< sDynModule > vecDynModules
Definition: dynamicloader.h:43
std::vector< DynModule * > vecLinkedModules
Definition: dynamicloader.h:47
Network * pNet_
Definition: dynamicloader.h:105
int char SLIInterpreter nest::Network *& pNet
Definition: neststartup.cpp:61
Definition: interpret.h:69
Main administrative interface to the network.
Definition: network.h:135
const std::string commandstring(void) const
Return sli command sequence to be executed for initialisation.
Definition: dynamicloader.cpp:118
Definition: dynamicloader.cpp:52
vecDynModules dyn_modules
Definition: dynamicloader.h:127
Base class for dynamically loadable SLI interpreter modules.
Definition: dynmodule.h:39
const std::string name(void) const
Return name of the module.
Definition: dynamicloader.cpp:113
Base class for all SLI Interpreter modules.
Definition: slimodule.h:34
vecDynModules & dyn_modules_
Definition: dynamicloader.h:106
UnloadModuleFunction unloadmodule_function
Definition: dynamicloader.h:115
static Dictionary * moduledict_
Dictionary for dynamically loaded modules.
Definition: dynamicloader.h:130
vecDynModules & dyn_modules_
Definition: dynamicloader.h:93
SLI interface of the Ddynamic module loader.
Definition: dynamicloader.h:58
void initLinkedModules(SLIInterpreter &)
Definition: dynamicloader.cpp:361
Definition: dynamicloader.h:83
DynamicLoaderModule(Network *pNet, SLIInterpreter &interpreter)
Definition: dynamicloader.cpp:86