26 #include "../include/charon-core/PluginManager.h" 
   27 #include "../include/charon-core/ParameteredObject.hxx" 
   28 #include "../include/charon-core/ParameteredGroupObject.h" 
   34         _versionInfo(versionInfo)
 
   36     if(paths.size() == 0) {
 
   37         throw std::invalid_argument(
"PluginLoader: Empty paths list given!");
 
   41     _initializePluginOnLoad=initializeOnLoad;
 
   45             const std::string& path1, 
const std::string& path2,
 
   48         _versionInfo(versionInfo)
 
   50     if (path2.size() > 0) {
 
   54     if (path1.size() == 0) {
 
   55         throw std::invalid_argument(
 
   56                 "PluginManger: at least one non-emtpy path has to be given!");
 
   60     _initializePluginOnLoad=initializeOnLoad;
 
   64     std::vector<ParameteredObject *> v;
 
   67     for (std::map<ParameteredObject *, PLUGIN_LOADER *>::iterator it =
 
   69         if (it->second == loader) {
 
   70             v.push_back(it->first);
 
   75     for (
unsigned int i = 0; i < v.size(); i++) {
 
   77         loader->destroyInstance(v[i]);
 
   85     while (!ordered.empty()) {
 
   90     for (std::map<std::string, PLUGIN_LOADER *>::iterator it =
 
  113     if (!isLoaded(name)) {
 
  115                 name, pluginPaths, libSuffix, _versionInfo);
 
  124         _loadedPlugins[name] = newPlugin;
 
  125         sout << 
"(DD) Plugin \"" << name << 
"\" loaded successfully." 
  129                 "A Plugin with the same name (\"" + name
 
  130                         + 
"\") is already loaded.", name,
 
  138     if (_loadedPlugins.find(nameL) != _loadedPlugins.end()) {
 
  139         _unloadPlugin(_loadedPlugins[nameL]);
 
  142                 "There is no Plugin loaded with the name \"" + name + 
"\".",
 
  161         const std::string & instanceName) 
const 
  163     std::map<std::string, ParameteredObject *>::const_iterator objIt =
 
  164             objects.find((instanceName));
 
  165     if (objIt != objects.end()) {
 
  166         return objIt->second;
 
  169                 + instanceName + 
"\" does not exist.", 
"unknown",
 
  176         std::string instanceName)
 
  179     if (instanceName == 
"") {
 
  181         instanceName = pluginName + 
"1";
 
  183         while (objects.find(instanceName) != objects.end()) {
 
  184             std::ostringstream nameGen;
 
  185             nameGen << pluginName << ++instNumber;
 
  186             instanceName = nameGen.str();
 
  189     if (instanceName == 
"" || objects.find(instanceName) == objects.end()) {
 
  190         if (_loadedPlugins.find(pluginName) == _loadedPlugins.end()) {
 
  192                 loadPlugin(pluginName);
 
  199                 loader->createInstance(instanceName, t);
 
  200         _instances[newInstance] = loader;
 
  201         objects[newInstance->
getName()] = newInstance;
 
  202         sout << 
"(DD) Created Instance \"" << newInstance->
getName()
 
  203                 << 
"\" of the plugin \"" << pluginName << 
"\", type " 
  208             "An instance with the name \"" + instanceName
 
  209                     + 
"\" already exists.", pluginName,
 
  215         const std::string & pluginName, 
const std::string & instanceName)
 
  217     return createInstance(pluginName, _defaultTemplateType, instanceName);
 
  222     if(isInternal(toDestroy))
 
  224     sout<<
"(II) Object "<<toDestroy->getName()<<
" is an internal object"<<std::endl;
 
  228     std::string cur = toDestroy->getName(), curPlugin;
 
  229     if (_instances.find(toDestroy) != _instances.end()) {
 
  230         objects.erase(toDestroy->getName());
 
  231         curPlugin = _instances[toDestroy]->getName();
 
  232         _instances[toDestroy]->destroyInstance(toDestroy);
 
  233         _instances.erase(toDestroy);
 
  235         if(objects.find(toDestroy->getName())!=objects.end())
 
  237             objects.erase(toDestroy->getName());
 
  243                 "This instance does not exist.", 
"unknown",
 
  247     sout << 
"(DD) Deleted Instance \"" << cur << 
"\" of the plugin \"" 
  248         << curPlugin << 
"\"" << std::endl;
 
  255     if (paramFile.
isSet(
"global.templatetype")) {
 
  256         std::string templateType = paramFile.
get<std::string> (
 
  257                 "global.templatetype");
 
  258         if (templateType == 
"int") {
 
  260         } 
else if (templateType == 
"float") {
 
  267     std::vector<std::string> keys = paramFile.
getKeyList();
 
  271         for (
unsigned int i = 0; i < keys.size(); i++) {
 
  272             if (keys[i].substr(keys[i].find_last_of(
".") + 1,
 
  273                     keys[i].find_first_of(
" ")) == 
"type") {
 
  274                 std::string pluginName = paramFile.
get<std::string> (keys[i]);
 
  278                 std::string instanceName = keys[i].substr(0,
 
  279                         keys[i].find_first_of(
"."));
 
  283                 if (paramFile.
isSet(instanceName + 
".templatetype")) {
 
  284                     std::string 
type = paramFile.
get<std::string> (
 
  285                         instanceName + 
".templatetype");
 
  288                     } 
else if (type == 
"float") {
 
  295                     pluginName, templateType, instanceName);
 
  301         sout << 
"(EE) Error during load: " << e.what() << std::endl;
 
  302     } 
catch (std::string s) {
 
  303         sout << 
"(EE) Error during load: " << s << std::endl;
 
  305         sout << 
"(EE) caught unknown exception during load" << std::endl;
 
  309     std::map<std::string, ParameteredObject*>::const_iterator objIter;
 
  311     for (objIter = 
objects.begin(); objIter != 
objects.end(); objIter++) {
 
  312         objIter->second->loadParameters(paramFile);
 
  313         objIter->second->loadSlots(paramFile, 
this);
 
  322     pf.
set<std::string> (
"global.templatetype",
 
  327         std::map<std::string, ParameteredObject*>::const_iterator objIter;
 
  330         for (objIter = 
objects.begin(); objIter != 
objects.end(); objIter++) {
 
  332             if (objIter->second->getTemplateType()
 
  334                 pf.
set<std::string> (objIter->second->getName()
 
  335                         + 
".templatetype", objIter->second->getTemplateType());
 
  338             objIter->second->save(pf);
 
  361     std::list<ParameteredObject*>::const_iterator iter;
 
  363     if (tPoints.empty()) {
 
  365             "Could not execute workflow:\n\t" 
  366             "No valid target point found.\n\tPlease check if " 
  367             "all required plugins could be loaded,\n\tthen check if this is " 
  368             "a valid parameter file.", 
"unknown",
 
  372     for (iter = tPoints.begin(); iter != tPoints.end(); iter++) {
 
  378         const std::set<std::string>& cur)
 const {
 
  383     std::set<std::string>::const_iterator curIter;
 
  384     std::set<std::string>::const_iterator tmpIter;
 
  385     std::set<std::string> newCur;
 
  386     std::set<std::string> tmp;
 
  389     visited.insert(cur.begin(), cur.end());
 
  392     for (curIter = cur.begin(); curIter != cur.end(); curIter++) {
 
  395         for (tmpIter = tmp.begin(); tmpIter != tmp.end(); tmpIter++) {
 
  396             if (visited.find(*tmpIter) == visited.end())
 
  397                 newCur.insert(*tmpIter);
 
  405         const std::set<std::string>& cur, 
const ParameterFile& pf)
 const {
 
  410     std::set<std::string>::const_iterator curIter;
 
  411     std::set<std::string>::const_iterator tmpIter;
 
  412     std::set<std::string> newCur;
 
  413     std::set<std::string> tmp;
 
  416     visited.insert(cur.begin(), cur.end());
 
  419     for (curIter = cur.begin(); curIter != cur.end(); curIter++) {
 
  422         for (tmpIter = tmp.begin(); tmpIter != tmp.end(); tmpIter++) {
 
  423             if (visited.find(*tmpIter) == visited.end())
 
  424                 newCur.insert(*tmpIter);
 
  432         const std::string& rootStr)
 const {
 
  433     std::map<std::string, ParameteredObject*>::const_iterator rootIter;
 
  434     rootIter = 
objects.find(rootStr);
 
  435     assert(rootIter != 
objects.end());
 
  437     return root->getNeighbours();
 
  441         const std::string& rootStr,
 
  443     std::map<std::string, ParameteredObject*>::const_iterator rootIter;
 
  444     rootIter = 
objects.find(rootStr);
 
  445     assert(rootIter != 
objects.end());
 
  447     return root->getNeighbours(pf);
 
  451         const std::string& root,
 
  453     std::set<std::string> visited;
 
  454     visited.insert(root);
 
  461         const std::string& root)
 const {
 
  462     std::set<std::string> visited;
 
  463     visited.insert(root);
 
  474     const std::map<std::string, Slot*>& mIn1 = obj1.
getInputSlots();
 
  475     const std::map<std::string, Slot*>& mIn2 = obj2.
getInputSlots();
 
  478     bool invalid = 
false;
 
  481             (mIn1.find(slot1.
getName()) == mIn1.end()) &&
 
  482             (mIn2.find(slot2.
getName()) == mIn2.end())) {
 
  483         sout << 
"(WW) attempt to connect output/output" << std::endl;
 
  487             ((mOu1.find(slot1.
getName()) == mOu1.end()) &&
 
  488              (mOu2.find(slot2.
getName()) == mOu2.end()))) {
 
  489         sout << 
"(WW) attempt to connect input/input" << std::endl;
 
  503     return connect(*slot1, *slot2);
 
  507         const std::string& slot1, 
const std::string& slot2) {
 
  509     std::string::size_type pos = slot1.find(
".");
 
  510     assert(pos != std::string::npos);
 
  511     std::string obj1st = slot1.substr(0, pos);
 
  512     std::string obj1sl = slot1.substr(pos + 1);
 
  514     pos = slot2.find(
".");
 
  515     assert(pos != std::string::npos);
 
  516     std::string obj2st = slot2.substr(0, pos);
 
  517     std::string obj2sl = slot2.substr(pos + 1);
 
  520     std::map<std::string, ParameteredObject*>::const_iterator objIter;
 
  521     objIter = 
objects.find(obj1st);
 
  522     assert(objIter != 
objects.end());
 
  524     objIter = 
objects.find(obj2st);
 
  525     assert(objIter != 
objects.end());
 
  529     const std::map<std::string, Slot*>& mIn1 = obj1->getInputSlots();
 
  530     const std::map<std::string, Slot*>& mIn2 = obj2->getInputSlots();
 
  531     const std::map<std::string, Slot*>& mOu1 = obj1->getOutputSlots();
 
  532     const std::map<std::string, Slot*>& mOu2 = obj2->getOutputSlots();
 
  533     Slot *slotP1, *slotP2;
 
  534     if (mIn1.find(obj1sl) != mIn1.end()) {
 
  535         slotP1 = mIn1.find(obj1sl)->second;
 
  536         if (mOu2.find(obj2sl) == mOu2.end()) {
 
  538                     "target slot ("+slot2+
") not found or no output slot");
 
  541         slotP2 = mOu2.find(obj2sl)->second;
 
  543     else if (mOu1.find(obj1sl) != mOu1.end()) {
 
  544         slotP1 = mOu1.find(obj1sl)->second;
 
  545         if (mIn2.find(obj2sl) == mIn2.end()) {
 
  547                     "target slot ("+slot2+
") not found or no input slot");
 
  550         slotP2 = mIn2.find(obj2sl)->second;
 
  553         sout << 
"(WW) slot not found: " << slot1 << std::endl;
 
  558     return connect(*slotP1,*slotP2);
 
  566         const std::string& slot2) {
 
  568     std::string::size_type pos = slot1.find(
".");
 
  569     assert(pos != std::string::npos);
 
  570     std::string obj1st = slot1.substr(0, pos);
 
  571     std::string obj1sl = slot1.substr(pos + 1);
 
  573     pos = slot2.find(
".");
 
  574     assert(pos != std::string::npos);
 
  575     std::string obj2st = slot2.substr(0, pos);
 
  576     std::string obj2sl = slot2.substr(pos + 1);
 
  579     std::map<std::string, ParameteredObject*>::const_iterator objIter;
 
  580     objIter = 
objects.find(obj1st);
 
  581     assert(objIter != 
objects.end());
 
  583     objIter = 
objects.find(obj2st);
 
  584     assert(objIter != 
objects.end());
 
  588     const std::map<std::string, Slot*>& mIn1 = obj1->getInputSlots();
 
  589     const std::map<std::string, Slot*>& mIn2 = obj2->getInputSlots();
 
  590     const std::map<std::string, Slot*>& mOu1 = obj1->getOutputSlots();
 
  591     const std::map<std::string, Slot*>& mOu2 = obj2->getOutputSlots();
 
  592     Slot *slotP1, *slotP2;
 
  593     if (mIn1.find(obj1sl) != mIn1.end()) {
 
  594         slotP1 = mIn1.find(obj1sl)->second;
 
  595         if (mOu2.find(obj2sl) == mOu2.end()) {
 
  597                     "target slot ("+slot2+
") not found or no output slot");
 
  600         slotP2 = mOu2.find(obj2sl)->second;
 
  602     else if (mOu1.find(obj1sl) != mOu1.end()) {
 
  603         slotP1 = mOu1.find(obj1sl)->second;
 
  604         if (mIn2.find(obj2sl) == mIn2.end()) {
 
  606                     "target slot ("+slot2+
") not found or no input slot");
 
  609         slotP2 = mIn2.find(obj2sl)->second;
 
  612         sout << 
"(WW) slot not found: " << slot1 << std::endl;
 
  629     std::set<std::string> pluginsU;
 
  633     for (std::vector<std::string>::const_iterator cur =
 
  639         std::vector<std::string> plugins =
 
  641         std::vector<std::string>::iterator pIterW;
 
  642         for (pIterW=plugins.begin(); pIterW != plugins.end(); pIterW++) {
 
  644             std::string& pName = *pIterW;
 
  647             if (pName.substr(pName.size()-2) == 
"_d") {
 
  648                 pName = pName.substr(0, pName.size()-2);
 
  652         pluginsU.insert(plugins.begin(),plugins.end());
 
  656     int pluginCount = 0 ;
 
  660     std::set<std::string>::const_iterator pIterU;
 
  661     std::list<std::string> skipped;
 
  662     for (pIterU=pluginsU.begin(); pIterU != pluginsU.end(); pIterU++) {
 
  668             sout << 
"(DD) " << std::endl;
 
  671             skipped.push_back(*pIterU);
 
  680     if (skipped.size() > 0) {
 
  681         sout << 
"(DD) The following libraries matched the exclude list:" 
  684     std::list<std::string>::const_iterator skipIter;
 
  685     for (skipIter=skipped.begin();skipIter!=skipped.end();skipIter++) {
 
  686         sout << 
"(DD) \t" << *skipIter << std::endl;
 
  690     sout << 
"(II) Finished generating metadata\n" 
  691          << 
"(II) Loaded " << pluginCount << 
" plugins" << std::endl ;
 
  699         const std::string& pluginName, 
const std::string& filename) {
 
  700     if (!pluginName.size()) {
 
  701         sout << 
"(EE) " << __FILE__ << 
":" << __LINE__ << 
"\t" 
  702             << 
"emtpy pluginName given (metadata generation)!\n" << std::endl;
 
  706         bool alreadyLoaded = 
isLoaded(pluginName);
 
  708         if (!alreadyLoaded) {
 
  715         if (!alreadyLoaded) {
 
  720         std::string errMsg = e.what();
 
  724             for (
size_t pos = errMsg.find(
"\n"); pos != std::string::npos;
 
  725                  pos=errMsg.find(
"\n",pos+1)) {
 
  726                 errMsg.replace(pos,1,
"\n(DD) \t");
 
  729                  << 
"\" is no charon plugin:\n(DD) \t" 
  730                  << e.what() << std::endl;
 
  733             for (
size_t pos = errMsg.find(
"\n"); pos != std::string::npos;
 
  734                  pos=errMsg.find(
"\n",pos+1)) {
 
  735                 errMsg.replace(pos,1,
"\n(EE) \t");
 
  737             sout << 
"(EE) Could not generate metadata for module \"" 
  740                  << errMsg << std::endl;
 
  743     } 
catch(
const std::exception& e) {
 
  744         sout << 
"(EE) Could not generate metadata for plugin \"" 
  745             << pluginName << 
"\":\n(EE) \t" 
  746             << 
"Possible execption in plugin constructor:\n(EE)\t" 
  747             << e.what() << std::endl ;
 
  749         sout << 
"(EE) Could not generate metadata for plugin \"" 
  750             << pluginName << 
"\":\n(EE) \t" 
  751             << 
"Possible non-standard execption in plugin constructor!" 
  763     std::list<ParameteredObject*> targetPoints;
 
  764     std::map<std::string, ParameteredObject *>::const_iterator it;
 
  766         if (it->second->_active){ 
 
  767             bool connected = 
false;
 
  768             bool activeTest = 
false;
 
  769             std::map<std::string, Slot *> outputslots =
 
  770                     it->second->getOutputSlots();
 
  771             std::map<std::string, Slot *>::const_iterator slotIter;
 
  772             for (slotIter = outputslots.begin(); !connected && slotIter
 
  773                  != outputslots.end(); slotIter++) {
 
  774                 connected = slotIter->second->connected();
 
  775                 const std::set<Slot*>& listOfTargets = slotIter->second->getTargets();
 
  776                 std::set<Slot*>::const_iterator tmp = listOfTargets.begin();
 
  777                 for (; tmp!=listOfTargets.end();tmp++) {
 
  778                     if ((*tmp)->getParent()._active){
 
  783             if (!connected || !(activeTest)) { 
 
  784                 sout << 
"(DD) Found target point \"" << it->second->getName()
 
  785                      << 
"\"" << std::endl;
 
  786                 targetPoints.push_back(it->second);
 
  795     std::reverse(waiting.begin(), waiting.end());
 
  796     std::list<ParameteredObject*> finished;
 
  800     while(!waiting.empty()) {
 
  803         finished.push_front(cur = waiting.front());
 
  805         const std::map<std::string, Slot*>& inputs = cur->
getInputSlots();
 
  806         std::map<std::string, Slot*>::const_iterator sIter;
 
  807         std::set<Slot*>::const_iterator tIter;
 
  808         for (sIter = inputs.begin(); sIter != inputs.end(); sIter++) {
 
  809             const std::set<Slot*>& targets = sIter->second->getTargets();
 
  810             for (tIter = targets.begin(); tIter != targets.end(); tIter++) {
 
  811                 waiting.push_front(&((*tIter)->getParent()));
 
  817     std::list<ParameteredObject*>::iterator iBegin = finished.begin();
 
  818     std::list<ParameteredObject*>::iterator iEnd = finished.end();
 
  819     std::list<ParameteredObject*>::iterator iter = iBegin;
 
  820     while (iter != iEnd) {
 
  826     if (iEnd != finished.end())
 
  827         finished.erase(iEnd, finished.end());
 
  845         throw std::runtime_error(
 
  846             std::string(
"attempt to insert an instance named ")
 
  848                 + 
"to a PluginManager that already handles " 
  849                 "an instance with the same name!");
 
  851     objects.insert(std::pair<std::string,ParameteredObject*>(
 
  852             instance->
getName(),instance));
 
  865     std::map<std::string, ParameteredObject *>::const_iterator iter;
 
  869             "Could not reset executed flags in workflow:\n\t" 
  870             "No valid target point found.\n\t" 
  871             "Please check if all required plugins could be loaded,\n\t" 
  872             "then check if this is a valid parameter file.", 
"unknown",
 
  882         (*iter).second->setExecuted(
false);
 
  887     const std::string& filePrefix) {
 
  890     if (paramFile.
isSet(
"global.templatetype")) {
 
  891         std::string templateType = paramFile.
get<std::string> (
 
  892                 "global.templatetype");
 
  893         if (templateType == 
"int") {
 
  895         } 
else if (templateType == 
"float") {
 
  902     std::vector<std::string> keys = paramFile.
getKeyList();
 
  906         for (
unsigned int i = 0; i < keys.size(); i++) {
 
  907             if (keys[i].substr(keys[i].find_last_of(
".") + 1,
 
  908                     keys[i].find_first_of(
" ")) == 
"type") {
 
  909                 std::string pluginName = paramFile.
get<std::string> (keys[i]);
 
  910                 bool alreadyLoaded = 
isLoaded(pluginName);
 
  911                 if (!alreadyLoaded) {
 
  914                 std::string instanceName = keys[i].substr(0,
 
  915                         keys[i].find_first_of(
"."));
 
  918                     pluginName, instanceName);
 
  919                 if (obj->isDynamic()) {
 
  921                     std::string targetFileName =
 
  922                             filePrefix + 
"_" + instanceName + 
".wrp";
 
  923                     sout << 
"(DD) saving dynamic metadata for module  to " 
  924                         << targetFileName << std::endl;
 
  928                 if (!alreadyLoaded) {
 
  934         sout << 
"(EE) Error during load: " << e.what() << std::endl;
 
  935     } 
catch (std::string s) {
 
  936         sout << 
"(EE) Error during load: " << s << std::endl;
 
  938         sout << 
"(EE) caught unknown exception during load" << std::endl;
 
  944         const ParameterFile& paramFile, 
const std::string& fileName) {
 
  946     if (!pluginName.size()) {
 
  947         sout << 
"(EE) " << __FILE__ << 
":" << __LINE__ << 
"\t" 
  948             << 
"emtpy pluginName given (dynamic metadata generation)!\n" 
  953         bool alreadyLoaded = 
isLoaded(pluginName);
 
  954         if (!alreadyLoaded) {
 
  963         if (!alreadyLoaded) {
 
  970                 << 
"\" is no charon plugin:\n(WW) \t" 
  971                 << e.what() << std::endl;
 
  974             sout << 
"(EE) Exception during (dynamic) metadata generation of \"" 
  977                 << e.what() << std::endl;
 
  984 bool PluginManager::initializePluginOnLoad()
 const {
 
  985     return _initializePluginOnLoad;
 
  988 void PluginManager::setInitiailizePluginOnLoad(
bool initOnLoad) {
 
  989     _initializePluginOnLoad = initOnLoad;
 
void saveParameterFile(ParameterFile ¶mFile) const 
save parameters and connections of all managed plugins 
 
A plugin with the same name is already loaded. 
 
File is a shared object but misses required functions. 
 
void clearMetadata()
delete metadata cache to save some space 
 
size_t getLoadedPluginsCount() const 
number of loaded plugins 
 
bool isInternal(ParameteredObject *obj)
Check if parametered object is an internal object. 
 
virtual const std::string getTemplateType() const 
get template type as string 
 
bool _generateMetadataForPlugin(const std::string &pluginName, const std::string &filename)
Creates metadata information for a specific plugin. 
 
std::string libSuffix
Lib suffix e.g. _d for debug builds. 
 
This class serves to store parameters used within the Charon Project. 
 
std::set< std::string > getNeighbours(const std::string &root) const 
Convenience function to get neighbours of given object. 
 
#define PLUGIN_EXTENSION
system plugin file extension (dll,so,dylib) 
 
const std::string & getPluginName() const 
Get Plugin Name. 
 
The template type of the instance is float. 
 
SplitStream sout
Dummy instance for usage in other files (for interface too). 
 
template_type
Integer which represents a template type. 
 
bool disconnect()
Remove all slot targets. 
 
void setDefaultTemplateType(ParameteredObject::template_type t)
Set the default template type property. 
 
virtual std::string templateTypeToString(ParameteredObject::template_type t) const 
Converts template_type to std::string. 
 
Base class for serializable objects. 
 
ErrorCode getErrorCode() const 
Plugin Exception Error Code. 
 
virtual std::set< std::string > getConnected(const std::string &root, const ParameterFile &pf) const 
Recurse into object list and find connected objects. 
 
const ParameterFile & getMetadata()
get metadata 
 
void createMetadata(const std::string &targetPath="")
generate plugin metadata and store to given path 
 
Requested instance doesn't exist. 
 
ParameteredObject::template_type _defaultTemplateType
current default template type. 
 
ParameteredObject & getParent()
get parent object 
 
void unloadPlugin(const std::string &name)
Unloads a plugin. 
 
void _destroyAllInstances(PLUGIN_LOADER *p)
Deletes all instances of a loaded plugin. 
 
void _getConnected(std::set< std::string > &visited, const std::set< std::string > &cur) const 
Recurse into object list and find connected objects. 
 
std::map< std::string, ParameteredObject * > objects
currently existing instances that are handled by this PluginManager 
 
The template type of the instance is double. 
 
bool connect(Slot &slot1, Slot &slot2)
Connect slots. 
 
std::vector< std::string > getKeyList(std::string beginsWith="") const 
Look for parameters beginning with a given string. 
 
bool isLoaded(const std::string &name) const 
Checks if a plugin is loaded. 
 
void setExcludeList(const std::vector< std::string > &list)
set exclude list 
 
const std::map< std::string, Slot * > & getOutputSlots() const 
Get all output slots as map. 
 
void _unloadPlugin(PLUGIN_LOADER *p, bool erase=true)
Unloads a plugin and destroys instances. 
 
size_t getInstancesCount() const 
number of handled instances 
 
virtual std::string getName() const 
Get slot name. 
 
std::map< ParameteredObject *, PLUGIN_LOADER * > _instances
Links the instances to their PluginLoader. 
 
void _unloadAllPlugins()
Unloads all Plugins and destroys all instances. 
 
void set(std::string parameter, const T &value=T())
Set a parameter to the given single value. 
 
virtual ~PluginManager()
default destructor 
 
The template type of the instance is integer. 
 
const std::vector< std::string > & getPluginPaths() const 
Gets the plugin paths. 
 
std::map< std::string, PLUGIN_LOADER * > _loadedPlugins
Saves the currently loaded plugins. 
 
void loadPlugin(std::string name)
Loads a plugin stored in the previously declared folder. 
 
void reset()
reset plugin manager 
 
T get(std::string parameter) const 
Get the value of a specified parameter. 
 
bool isSet(std::string parameter) const 
Check if a givem parameter has already been set. 
 
ParameteredObject * createInstance(std::string pluginName, ParameteredObject::template_type t, std::string instanceName="")
Create a new instance of a plugin. 
 
PluginVersionCheckLevel
info how to handle version information 
 
std::list< ParameteredObject * > determineExecutionOrder()
Determine execution order. 
 
std::vector< std::string > pluginPaths
Paths where the plugins are stored. 
 
While unloading a plugin or deleting an instance: The plugin is not loaded. 
 
const std::map< std::string, Slot * > & getInputSlots() const 
Get all input slots as map. 
 
void runWorkflow()
run whole workflow 
 
charon_core_DLL_PUBLIC std::string type(const std::string &typeInfo)
Get type representation. 
 
Commom properties of slot objects. 
 
An instance with the same name already exists. 
 
std::vector< std::string > _excludeList
exclude list for metadata generation 
 
void printWarning(const std::string &msg) const 
print warning message with slot name to sout 
 
virtual void prepareDynamicInterface(const ParameterFile &file)
prepare interface of parameters and slots 
 
ParameteredObject * getInstance(const std::string &instanceName) const 
get an existing instance of a loaded plugin. 
 
void destroyInstance(ParameteredObject *toDestroy)
Delete an instance of a loaded plugin. 
 
Version information for the plugin is missing while explicit version check was requested. 
 
bool disconnect(Slot &slot1, Slot &slot2)
Disconnect slots. 
 
bool save(std::string fileName) const 
Save parameters and values to a plain text file. 
 
const std::string & getName() const 
instance name 
 
ParameteredObject::template_type getDefaultTemplateType() const 
Get the default template type property. 
 
void resetExecuted()
Set the executed flags of the objects to false. 
 
void insertInstance(ParameteredObject *instance)
Insert an existing parametered object instance. 
 
PluginManager(const std::vector< std::string > &pluginPaths, bool debugSuffix=DEFAULT_DEBUG_SUFFIX, bool initializeOnLoad=false, PluginVersionCheckLevel versionInfo=PluginVersionIgnore)
default constructor 
 
void createDynamicMetadata(const ParameterFile ¶mFile, const std::string &filePrefix)
generate plugin metadata for dynamic plugins and store to given path 
 
std::list< ParameteredObject * > _determineTargetPoints()
Look for execution target points. 
 
bool connect(Slot &target)
Connect with given slot. 
 
void loadParameterFile(const ParameterFile &pf)
Reads a parameter file. 
 
#define PLUGIN_LOADER
plugin loader classname (unix/win)