16 #include "../include/charon-core/ParameteredGroupObject.h"
17 #include "../include/charon-core/PluginManager.h"
24 _addParameter<bool>(debugSuffix,
"debugSuffix",
"Load debug plugins suffixed with '_d'",1);
25 _addParameter(workFlowFile,
"workflowfile",
"The workflow contained in this group",
"FileOpen");
42 std::vector<VirtualInputSlot*> vinput=_inputs->
getSlotVector();
43 for(
size_t i=0;i<vinput.size();i++)
53 _loopOutputNumber.clear();
57 std::vector<VirtualOutputSlot*> voutput=_outputs->
getSlotVector();
58 for(
size_t i=0;i<voutput.size();i++)
75 const std::map<std::string, ParameteredObject*>& objs=_pluginMan->
getObjectList();
77 std::map<std::string, ParameteredObject *>::const_iterator it=objs.begin();
78 for(;it!=objs.end();it++)
91 std::vector<VirtualInputSlot*> vinput=_inputs->
getSlotVector();
92 for(
size_t i=0;i<vinput.size();i++)
97 std::stringstream pname;
98 pname<<
"loop_input_"<<i<<
"_to_output";
99 std::stringstream pdoc;
100 pdoc<<
"The input "<<i<<
" gets the data of the given output after one iteration of a loop. To disable the connection, set to -1";
102 _loopOutputNumber.push_back(par);
107 std::vector<VirtualOutputSlot*> voutput=_outputs->
getSlotVector();
108 for(
size_t i=0;i<voutput.size();i++)
111 onAddOutputSlot(out);
117 #pragma message ("need to load slotbundle connections")
181 out->setLoopPartner(in);
183 _loopedSlots.insert(std::pair<int,VirtualOutputSlot*>(input,out));
188 std::map<int,VirtualOutputSlot*>::iterator it;
189 it=_loopedSlots.find(input);
190 if(it==_loopedSlots.end())
191 sout<<this->
getName()<<
": Input "<<input<<
" is not looped!";
194 out->setLoopPartner(0);
196 _loopedSlots.erase(it);
201 std::map<int,VirtualOutputSlot*>::iterator it=_loopedSlots.begin();
202 for(;it!=_loopedSlots.end();it++)
211 std::map<int,VirtualOutputSlot*>::iterator it=_loopedSlots.begin();
212 for(;it!=_loopedSlots.end();it++)
221 workFlowFile.
load(file);
228 for(
size_t i=0; i<_loopOutputNumber.size(); i++) {
243 std::map<std::string, ParameteredObject *>::const_iterator iter;
247 "Could not reset executed flags in workflow:\n\t"
248 "No valid target point found.\n\t"
249 "Please check if all required plugins could be loaded,\n\t"
250 "then check if this is a valid parameter file.",
"unknown",
260 (*iter).second->setExecuted(value);
void saveParameterFile(ParameterFile ¶mFile) const
save parameters and connections of all managed plugins
void loopInputToOutput(int input, int output)
LoopOutToInput.
virtual void finalize()
finalize plugin
Interface for a plugin manager.
void finalize()
Finalization.
Manages ParameteredObject based plugins and their instances.
This class serves to store parameters used within the Charon Project.
ParameterList< std::string > pluginPaths
plugin search paths which are used when executing this loop
SplitStream sout
Dummy instance for usage in other files (for interface too).
void initialize()
Initialization.
bool _removeSomething(const std::string &extension, const std::string &name)
Remove something. Iverse of _addSomething.
Base class for serializable objects.
virtual void load(const ParameterFile &pf)
Load from ParameterFile.
ParameteredGroupObject(const std::string &className="ParameteredGroupObject", const std::string &name="", const std::string &doc="")
Default constructor.
Interface for OutputSlotBundle.
void _setDynamic(bool v)
Specifies if the ParameteredObject is dynamic.
void _removeOutputSlot(std::string name)
Remove an output slot.
std::string getName() const
get the Name
std::string getType() const
overloaded getType
void _removeInputSlot(std::string name)
Remove an input slot.
void _addInputSlot(Slot &slot, const std::string &name, const std::string &doc, const std::string &type="")
These functions needs to be called by the derived class in order to register all objects which can be...
virtual void finalizeGroup()
Finalization.
void reset()
reset plugin manager
virtual void executeGroup()
Execution.
void enableLoopConnections()
enableLoopConnections
virtual void load(const ParameterFile &pf)
Load from ParameterFile.
void _addParameter(AbstractParameter ¶m, const std::string &name, const std::string &doc, const std::string &type="")
Add parameters.
void runWorkflow()
run whole workflow
virtual void onSave(ParameterFile &pf) const
Custom save.
void _addOutputSlot(Slot &slot, const std::string &name, const std::string &doc, const std::string &type="")
Register output slot.
virtual std::vector< VirtualOutputSlot * > & getSlotVector()=0
get virtual inputs to be exposed in parent workflow.
virtual void initializeGroup()
Group Initialization.
virtual void setExecuted(bool value)
set property _executed
const std::map< std::string, ParameteredObject * > & getObjectList() const
Get names of existing instances.
virtual void initialize()
initialize plugin
const std::string & getName() const
instance name
virtual std::string getDisplayName() const
Get slot display name.
virtual ~ParameteredGroupObject()
Default deconstructor.
virtual void onLoad(const ParameterFile &pf, const PluginManagerInterface *man)
Custom load.
void breakLoop(int input)
breakLoop
virtual std::vector< VirtualInputSlot * > & getInternalSlotVector()=0
get virtual inputs to be exposed in group workflow.
void disableLoopConnections()
disableLoopConnections
virtual void setExecuted(bool value)
set property _executed
virtual void prepareDynamicInterface(const ParameterFile &file)
Prepare the interface.
void loadParameterFile(const ParameterFile &pf)
Reads a parameter file.