CellModules
CellPlugin.hpp
Go to the documentation of this file.
1//'''
2#ifndef BASEPROJECT_CELLPLUGIN_HPP
3#define BASEPROJECT_CELLPLUGIN_HPP
4
5/*isigen:eval@lowerFirstLetter'''
6 def lowerFirstLetter(s):
7 return s[0].lower() + s[1:]
8 '''*/
9
10/*isigen:insert@includes'''
11 print('\n'.join(["#include \"../../{modulesFolder}/{folderName}/{pluginFileName}.hpp\"".\
12 format(modulesFolder=cellModulesPath,folderName=m,pluginFileName=configJson["Plugin"]["className"]) for m,configJson in modulesConfigs.items() if "Plugin" in configJson]))
13 '''*/
14
15
16template<typename cell_t>
17struct CellPlugin {
18 CellPlugin() = default;
19
20 /*isigen:insert@modulesDefinition'''
21 print('\n'.join(["\t{pluginClassName}<cell_t> {varName};".format(pluginClassName=configJson["Namespace"]+"::"+configJson["Plugin"]["className"],varName=lowerFirstLetter(configJson["Plugin"]["className"])) for configJson in modulesConfigs.values() if "Plugin" in configJson]))
22 '''*/
23
24 template <typename world_t>
25 void onRegister(world_t *w)
26 {
27 /*isigen:insert@modulesRegister'''
28 print('\n'.join(["\t\tw->registerPlugin({varName});".format(varName=lowerFirstLetter(configJson["Plugin"]["className"])) for configJson in modulesConfigs.values() if "Plugin" in configJson]))
29 '''*/
30 }
31};
32
33
34#endif //BASEPROJECT_CELLPLUGIN_HPP
35//'''
void onRegister(world_t *w)
Definition: CellPlugin.hpp:25
CellPlugin()=default