charon-core  0.3.1
ParameteredGroupObject.h
1 /* This file is part of Charon.
2 
3  Charon is free software: you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as published by
5  the Free Software Foundation, either version 3 of the License, or
6  (at your option) any later version.
7 
8  Charon is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU Lesser General Public License for more details.
12 
13  You should have received a copy of the GNU Lesser General Public License
14  along with Charon. If not, see <http://www.gnu.org/licenses/>.
15 */
16 #ifndef PARAMETEREDGROUPOBJECT_H
17 #define PARAMETEREDGROUPOBJECT_H
18 
19 #include "ParameteredObject.h"
20 #include "PluginManager.h"
21 #include "SlotBundleInterfaces.h"
22 
24 //class OutputSlotBundle: public SlotBundle
25 //{
26 //public:
27 // OutputSlotBundle(const std::string& className,
28 // const std::string& name = "", const std::string& doc = "");
29 // std::vector<VirtualOutputSlot*>& getSlotVector();
30 // std::vector<VirtualInputSlot*>& getInternalSlotVector();
31 //protected:
32 // void _addAllSlots();
33 // void _removeAllSlots();
34 //};
35 
37 {
38 public:
40 
46  ParameteredGroupObject(const std::string& className="ParameteredGroupObject",
47  const std::string& name = "", const std::string& doc = "");
48 
51  Parameter< bool > debugSuffix;
52  Parameter<std::string> workFlowFile;
53 
55  virtual ~ParameteredGroupObject();
56 
58 
61  virtual void prepareDynamicInterface(const ParameterFile &file);
62 
64 
65  void initialize();
66 
68 
69  virtual void initializeGroup();
70 
72 
73  void execute();
74 
76 
77  virtual void executeGroup();
78 
80 
81  void finalize();
82 
84 
85  virtual void finalizeGroup();
86 
88 
91  void loopInputToOutput(int input,int output);
92 
94 
96  void breakLoop(int input);
97 
99 
101  void enableLoopConnections();
102 
104  void disableLoopConnections();
105 
107 
108  virtual void onSave(ParameterFile &pf) const;
109 
111 
112  virtual void onLoad(const ParameterFile &pf, const PluginManagerInterface *man);
113 
114  virtual void setExecuted(bool value);
115 
116 protected:
117  virtual void onAddInputSlot(VirtualInputSlot* in);
118  virtual void onAddOutputSlot(VirtualOutputSlot* out);
119  PluginManager* _pluginMan;
122  std::map<int,VirtualOutputSlot*> _loopedSlots;
123  std::vector<Parameter<int>* > _loopOutputNumber; //For ever
124 };
125 
126 #endif // PARAMETEREDGROUPOBJECT_H
virtual void finalize()
finalize plugin
Interface for a plugin manager.
Manages ParameteredObject based plugins and their instances.
This class serves to store parameters used within the Charon Project.
Definition: ParameterFile.h:68
ParameterList< std::string > pluginPaths
plugin search paths which are used when executing this loop
virtual void onSave(ParameterFile &pf) const
Custom Save operation.
Base class for serializable objects.
Interface for OutputSlotBundle.
virtual void onLoad(const ParameterFile &pf, const PluginManagerInterface *man)
Custom Load operation.
std::map< std::string, Slot * > _inputs
Input slots.
Declaration of the base class ParameteredObject.
Interface for InputSlotBundle.
Implements a class which handles plugins and their instances.
virtual void execute()
execute plugin code
virtual void initialize()
initialize plugin
virtual void prepareDynamicInterface(const ParameterFile &file)
prepare interface of parameters and slots
std::map< std::string, Slot * > _outputs
Output slots.
#define charon_groups_DLL_PUBLIC
Preprocessor macro to define this class/function as public visible, i.e.
Definition: DllEx.h:84
virtual void setExecuted(bool value)
set property _executed