charon-core  0.3.1
InputSlotBundle.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 InputSlotBundle::InputSlotBundle(const std::string& name) :
29  SlotBundle(
30  "InputSlotBundle", name,
31  "<h2>Input slots to be used with groups</h2><br>"
32  "Input slots to be used with groups. This plugin can be loaded "
33  "into a group workflow file. It creates an input 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 }
46 
49  create(const std::string& name, ParameteredObject::template_type) {
50  return new InputSlotBundle(name);
51 }
52 
55  delete b;
56 }
57 
58 void InputSlotBundle::_removeSlot(int i) {
59  _removeOutputSlot(_virtualOutputSlots[i]->getName());
60 }
61 
62 std::vector<VirtualInputSlot*>& InputSlotBundle::getSlotVector() {
63  return _virtualInputSlots;
64 }
65 
67  _addOutputSlot(*((Slot*)_virtualOutputSlots[i]),
68  _virtualOutputSlots[i]->getName(),
69  "Virtual Slot",_virtualOutputSlots[i]->getType());
70 
71 }
72 
75 #ifdef _DEBUG
77 #else
79 #endif
80 }
81 
82 std::vector<VirtualOutputSlot *> & InputSlotBundle::getInternalSlotVector()
83 {
84  return _virtualOutputSlots;
85 }
std::vector< VirtualInputSlot * > & getSlotVector()
get virtual inputs to be exposed in parent workflow.
build_type
defined build type
template_type
Integer which represents a template type.
Base class for serializable objects.
Input slots to be used with groups.
Convenience file to iclude all ParameteredObject dependencies and Template functions.
std::vector< VirtualOutputSlot * > & getInternalSlotVector()
get virtual inputs to be exposed in group workflow.
void _setTags(const std::string &tags)
Register additional tag names for grouping ParameteredObjects.
void _removeOutputSlot(std::string name)
Remove an output slot.
the object was compiled in release mode
InputSlotBundle(const std::string &name="")
default constructor
inputslotbundle_DECLDIR void destroy(ParameteredObject *b)
Deletes an instance of the plugin.
inputslotbundle_DECLDIR ParameteredObject * create(const std::string &name, ParameteredObject::template_type)
Creates an instance of the plugin.
#define inputslotbundle_DECLDIR
Not needed without MSVC.
the object was compiled in debug mode
Commom properties of slot objects.
Definition: Slots.h:47
void _addOutputSlot(Slot &slot, const std::string &name, const std::string &doc, const std::string &type="")
Register output slot.
void _addSlot(int i)
Update object.
const std::string & getName() const
instance name
inputslotbundle_DECLDIR ParameteredObject::build_type getBuildType()
Report build configuration to prevent linking of incompatibel runtime libs.