charon-core  0.3.1
ForStatement.h
1 /* Copyright (C) 2012 Gerald Mwangi
2  Copyright (C) 2012 Michael Baron
3 
4  This file is part of Charon.
5 
6  Charon is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Charon is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with Charon. If not, see <http://www.gnu.org/licenses/>.
18 */
27 #ifndef _FORSTATEMENT_H_
28 #define _FORSTATEMENT_H_
29 
30 #ifdef _MSC_VER
31 #ifdef forstatement_EXPORTS
32 #define forstatement_DECLDIR __declspec(dllexport)
34 #else
35 #define forstatement_DECLDIR __declspec(dllimport)
36 #endif /*Export or import*/
37 #else
38 #define forstatement_DECLDIR
40 #endif
41 
43 #include "StatementIntf.h"
44 
46 
50 class forstatement_DECLDIR ForStatement : public ParameteredObject,public StatementIntf {
51 public:
54  ForStatement(const std::string& name = "");
55 
62 
65 
66  virtual bool operator ()() const;
67 
68 protected:
70  virtual void execute();
71  virtual void reset();
72 private:
73  int _initialValue;
74  int _incrementValue;
75  int _finalValue;
76  int _currentValue;
77 };
78 
79 #endif /* _FORSTATEMENT_H_ */
80 
Base class for serializable objects.
InputSlot< double > initialValue
input slot for initial value
Definition: ForStatement.h:57
Declaration of the base class ParameteredObject.
OutputSlot< int > currentValue
output slot for current value
Definition: ForStatement.h:64
ForStatement module to be used in counting loops.
Definition: ForStatement.h:50
InputSlot< double > incrementValue
input slot for increment value
Definition: ForStatement.h:59
virtual void execute()
execute plugin code
InputSlot< double > finalValue
input slot for final value
Definition: ForStatement.h:61