charon-core  0.3.1
IfGroup.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 */
24 #include "../include/charon-core/ParameteredObject.hxx"
25 #include "../include/charon-core/IfGroup.h"
26 
27 
28 IfGroup::IfGroup(const std::string& name) :
30  "IfGroup", name,
31  "<h2>Execute a group of objects if a given statement is "
32  "true</h2><br>"
33  "Execute a group of objects if a given statement is true"
34  )
35 {
36  ParameteredObject::_setTags("charon-core") ;
37 
39  statement, "statement",
40  "determines if group is executed", "bool");
41 }
42 
43 
45  if(this->statement) {
47  }
48 }
49 
50 // the following functions are needed
51 // for class IfGroup to work as a charon plugin.
54  create(const std::string& name, ParameteredObject::template_type) {
55  return new IfGroup(name);
56 }
57 
60  delete b;
61 }
62 
65 #ifdef _DEBUG
67 #else
69 #endif
70 }
ifgroup_DECLDIR void destroy(ParameteredObject *b)
delete IfGroup
Definition: IfGroup.cpp:59
IfGroup(const std::string &name="")
default constructor
Definition: IfGroup.cpp:28
build_type
defined build type
template_type
Integer which represents a template type.
Base class for serializable objects.
virtual void executeGroup()
Update object.
Definition: IfGroup.cpp:44
#define ifgroup_DECLDIR
Not needed without MSVC.
Definition: IfGroup.h:36
void _setTags(const std::string &tags)
Register additional tag names for grouping ParameteredObjects.
ifgroup_DECLDIR ParameteredObject * create(const std::string &name, ParameteredObject::template_type)
create new IfGroup
Definition: IfGroup.cpp:54
the object was compiled in release mode
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...
Execute a group of objects if a given statement is true.
Definition: IfGroup.h:44
virtual void executeGroup()
Execution.
InputSlot< bool > statement
determines if group is executed
Definition: IfGroup.h:51
the object was compiled in debug mode
ifgroup_DECLDIR ParameteredObject::build_type getBuildType()
Report build configuration to prevent linking of incompatibel runtime libs.
Definition: IfGroup.cpp:64