charon-core  0.3.1
OutputSlotBundle.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2012 Gerald Mwangi
2 
3  This file is part of Charon.
4 
5  Charon is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Charon is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Charon. If not, see <http://www.gnu.org/licenses/>.
17 */
27 
28 OutputSlotBundle::OutputSlotBundle(const std::string& name) :
29  SlotBundle(
30  "OutputSlotBundle", name,
31  "<h2>Output slots to be used with groups</h2><br>"
32  "Output slots to be used with groups. This plugin can be loaded "
33  "into a group workflow file. It creates an output interface for "
34  "the group object in the parent workflow. The number of slots "
35  "(termed virtual slots) is defined by a parameter and each "
36  "virtual slot can be connected to any interior plugin (or slot "
37  "thereof) of any type. Once connected, the virtual slot takes on "
38  "the type of the connected interior slot. In the parent worfklow "
39  "the virtual slot then behaves exactly like the interior slot "
40  "(same type, same name)."
41  )
42 {
43  ParameteredObject::_setTags("charon-core") ;
44 }
45 
48  create(const std::string& name, ParameteredObject::template_type) {
49  return new OutputSlotBundle(name);
50 }
51 
54  delete b;
55 }
56 
59 #ifdef _DEBUG
61 #else
63 #endif
64 }
65 
66 std::vector<VirtualOutputSlot *> & OutputSlotBundle::getSlotVector()
67 {
68  return _virtualOutputSlots;
69 }
70 
71 std::vector<VirtualInputSlot *> & OutputSlotBundle::getInternalSlotVector()
72 {
73  return _virtualInputSlots;
74 }
75 
77 {
78  _addInputSlot(*((Slot*)_virtualInputSlots[i]),
79  _virtualInputSlots[i]->getName(),
80  "Virtual Slot",_virtualInputSlots[i]->getType());
81 }
82 
83 void OutputSlotBundle::_removeSlot(int i)
84 {
85  _removeInputSlot(_virtualInputSlots[i]->getName());
86 }
build_type
defined build type
std::vector< VirtualInputSlot * > & getInternalSlotVector()
get virtual inputs to be exposed in group workflow.
OutputSlotBundle(const std::string &name="")
default constructor
template_type
Integer which represents a template type.
Base class for serializable objects.
Convenience file to iclude all ParameteredObject dependencies and Template functions.
std::vector< VirtualOutputSlot * > & getSlotVector()
get virtual inputs to be exposed in parent workflow.
void _setTags(const std::string &tags)
Register additional tag names for grouping ParameteredObjects.
the object was compiled in release mode
Output slots to be used with groups.
outputslotbundle_DECLDIR ParameteredObject * create(const std::string &name, ParameteredObject::template_type)
Creates an instance of the plugin.
outputslotbundle_DECLDIR ParameteredObject::build_type getBuildType()
Report build configuration to prevent linking of incompatibel runtime libs.
void _removeInputSlot(std::string name)
Remove an input slot.
outputslotbundle_DECLDIR void destroy(ParameteredObject *b)
Deletes an instance of the plugin.
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...
the object was compiled in debug mode
Commom properties of slot objects.
Definition: Slots.h:47
const std::string & getName() const
instance name
#define outputslotbundle_DECLDIR
Not needed without MSVC.
void _addSlot(int i)
Update object.