Exemplo n.º 1
0
        ArgsParser::ArgsErrorCode parseConfigs(int argc, char **argv)
        {
            ArgsParser& ap = ArgsParser::getInstance();
            PluginConnector& pluginConnector = Environment<>::get().PluginConnector();

            po::options_description simDesc(simulationClass->pluginGetName());
            simulationClass->pluginRegisterHelp(simDesc);
            ap.addOptions(simDesc);

            po::options_description initDesc(initClass->pluginGetName());
            initClass->pluginRegisterHelp(initDesc);
            ap.addOptions(initDesc);

            po::options_description pluginDesc(pluginClass->pluginGetName());
            pluginClass->pluginRegisterHelp(pluginDesc);
            ap.addOptions(pluginDesc);

            // setup all boost::program_options and add to ArgsParser
            BoostOptionsList options = pluginConnector.registerHelp();

            for (BoostOptionsList::const_iterator iter = options.begin();
                 iter != options.end(); ++iter)
            {
                ap.addOptions(*iter);
            }

            // parse environment variables, config files and command line
            return ap.parse(argc, argv);
        }
Exemplo n.º 2
0
        bool parseConfigs(int argc, char **argv)
        {
            ArgsParser& ap = ArgsParser::getInstance();
            ModuleConnector& module_connector = ModuleConnector::getInstance();

            po::options_description simDesc(simulationClass->moduleGetName());
            simulationClass->moduleRegisterHelp(simDesc);
            ap.addOptions(simDesc);

            po::options_description initDesc(initClass->moduleGetName());
            initClass->moduleRegisterHelp(initDesc);
            ap.addOptions(initDesc);

            po::options_description analyserDesc(analyserClass->moduleGetName());
            analyserClass->moduleRegisterHelp(analyserDesc);
            ap.addOptions(analyserDesc);

            // setup all boost::program_options and add to ArgsParser
            BoostOptionsList options = module_connector.registerHelp();

            for (BoostOptionsList::const_iterator iter = options.begin();
                 iter != options.end(); ++iter)
            {
                ap.addOptions(*iter);
            }

            // parse environment variables, config files and command line
            return ap.parse(argc, argv);
        }
Exemplo n.º 3
0
 void pluginLoad()
 {
     simulationClass->load();
     mappingDesc = simulationClass->getMappingDescription();
     pluginClass->setMappingDescription(mappingDesc);
     initClass->setMappingDescription(mappingDesc);
 }
Exemplo n.º 4
0
 void moduleLoad()
 {
     simulationClass->load();
     mappingDesc = simulationClass->getMappingDescription();
     analyserClass->setMappingDescription(mappingDesc);
     initClass->setMappingDescription(mappingDesc);
 }
Exemplo n.º 5
0
 void pluginUnload()
 {
     PluginConnector& pluginConnector = Environment<>::get().PluginConnector();
     pluginConnector.unloadPlugins();
     initClass->unload();
     pluginClass->unload();
     simulationClass->unload();
 }
Exemplo n.º 6
0
 void moduleUnload()
 {
     ModuleConnector& module_connector = ModuleConnector::getInstance();
     module_connector.unloadModules();
     initClass->unload();
     analyserClass->unload();
     simulationClass->unload();
 }