charon-core  0.3.1
VirtualSlotSwitch.h
Go to the documentation of this file.
1 /* Copyright (C) 2013 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 */
24 #ifndef _VIRTUALSLOTSWITCH_H_
25 #define _VIRTUALSLOTSWITCH_H_
26 
27 #ifdef _MSC_VER
28 #ifdef virtualslotswitch_EXPORTS
29 #define virtualslotswitch_DECLDIR __declspec(dllexport)
31 #else
32 #define virtualslotswitch_DECLDIR __declspec(dllimport)
33 #endif /*Export or import*/
34 #else
35 #define virtualslotswitch_DECLDIR
37 #endif
38 
40 
43 
47 public:
50  VirtualSlotSwitch(const std::string& name = "");
56 
59 
62 
63  Parameter< bool > boolean_inputnumber;
64 protected:
66  virtual void execute();
67  virtual void prepareDynamicInterface(const ParameterFile &file);
68  std::vector< VirtualInputSlot* > _virtualInputSlots;
69  std::vector<VirtualOutputSlot*> _virtualOutputSlots;
70  int oldselection;
71 
72  void setNumberOfVirtualSlots(int num);
73 };
74 
75 #endif /* _VIRTUALSLOTSWITCH_H_ */
This class serves to store parameters used within the Charon Project.
Definition: ParameterFile.h:68
Parameter< int > number_of_inputs
number_of_inputs
Base class for serializable objects.
Declaration of the base class ParameteredObject.
InputSlot< bool > statement
statement to switch between input 0 and input 1
Connects its output to one of its inputs according to a statement or inputnumber. ...
VirtualOutputSlot output
output connected to one of the inputs
virtual void execute()
execute plugin code
#define virtualslotswitch_DECLDIR
Not needed without MSVC.
virtual void prepareDynamicInterface(const ParameterFile &file)
prepare interface of parameters and slots
InputSlot< int > inputnumber
connects output to according input