Operations.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarX::Core
19 * @author Kai Welke (welke _at_ kit _dot_ edu)
20 * @date 2012 Kai Welke
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24 
25 #pragma once
26 
29 
30 namespace armarx
31 {
32  class Operation;
33 
34  /**
35  * Typedef of OperationPtr as IceInternal::Handle<Operation> for convenience.
36  */
38 
39  /**
40  * @class Operation
41  * @ingroup Conditions
42  *
43  * Operation is the superclass for all logical operators within an expression tree.
44  * This superclass provides a getter for the type of operation and implements
45  * the slice OperationBase interface. Further it inherits the TermImpl superclass
46  * in order to be usable in an expression tree.
47  */
49  virtual public TermImpl,
50  virtual public OperationBase
51  {
52  public:
53  /**
54  * Retrieve the type of the operation. Either eOperationAnd, eOperationOr, eOperationNot, or eUndefinedOperation.
55  *
56  * @return type of the operation
57  */
58  OperationType getOperationType(const Ice::Current& c = Ice::emptyCurrent) const override;
59  protected:
60  // required for Ice::ObjectFactory
61  Operation();
62 
63 
64  };
65 
66  /**
67  * @class OperationAnd
68  * @ingroup Conditions
69  *
70  * OperationAnd implements a logical AND operation within the expression tree.
71  */
73  virtual public Operation,
74  virtual public OperationAndBase
75  {
76  template <class BaseClass, class VariantClass>
77  friend class GenericFactory;
78  public:
79  /**
80  * Constructs a logical AND operation on the two terms a and b
81  *
82  * @param a first term
83  * @param b second term
84  */
86 
87  /**
88  * Implementation for updating this term from its children in the expression tree. Inherited from TermImpl.
89  */
90  void update(const Ice::Current& c = Ice::emptyCurrent) override;
91  void updateWithData(const Ice::Current&) override;
92 
93  /**
94  * output operation to stream
95  *
96  * @param out output stream
97  */
98  void output(std::ostream& out) const override;
99 
100  /**
101  * Retrieve string identifying the operation.
102  *
103  * @return string identifier
104  */
105  std::string getOperationString(const Ice::Current& c = Ice::emptyCurrent) override;
106 
107  /**
108  * Reimplementation of the ice_clone method.
109  *
110  * @return clone of the object
111  */
112  Ice::ObjectPtr ice_clone() const override;
113 
114  protected:
115  OperationAnd();
116  };
117 
118  /**
119  * @class OperationOr
120  * @ingroup Conditions
121  *
122  * OperationOr implements a logical OR operation within the expression tree.
123  */
125  virtual public Operation,
126  virtual public OperationOrBase
127  {
128  template <class BaseClass, class VariantClass>
129  friend class GenericFactory;
130  public:
131  /**
132  * Constructs a logical OR operation on the two terms a and b
133  *
134  * @param a first term
135  * @param b second term
136  */
138 
139  /**
140  * Implementation for updating this term from its children in the expression tree. Inherited from TermImpl.
141  */
142  void update(const Ice::Current& c = Ice::emptyCurrent) override;
143  void updateWithData(const Ice::Current&) override;
144 
145  /**
146  * output operation to stream
147  *
148  * @param out output stream
149  */
150  void output(std::ostream& out) const override;
151 
152  /**
153  * Retrieve string identifying the operation.
154  *
155  * @return string identifier
156  */
157  std::string getOperationString(const Ice::Current& c = Ice::emptyCurrent) override;
158 
159  /**
160  * Reimplementation of the ice_clone method.
161  *
162  * @return clone of the object
163  */
164  Ice::ObjectPtr ice_clone() const override;
165 
166  protected:
167  OperationOr();
168  };
169 
170  /**
171  * @class OperationNot
172  * @ingroup Conditions
173  *
174  * OperationNot implements a logical NOT operation within the expression tree.
175  */
177  virtual public Operation,
178  virtual public OperationNotBase
179  {
180  template <class BaseClass, class VariantClass>
181  friend class GenericFactory;
182  public:
183  /**
184  * Constructs a logical NOT operation from the term
185  *
186  * @param a term
187  */
189 
190  /**
191  * Implementation for updating this term from its children in the expression tree. Inherited from TermImpl.
192  */
193  void update(const Ice::Current& c = Ice::emptyCurrent) override;
194  void updateWithData(const Ice::Current&) override;
195 
196  /**
197  * output operation to stream
198  *
199  * @param out output stream
200  */
201  void output(std::ostream& out) const override;
202 
203  /**
204  * Retrieve string identifying the operation.
205  *
206  * @return string identifier
207  */
208  std::string getOperationString(const Ice::Current& c = Ice::emptyCurrent) override;
209 
210  /**
211  * Reimplementation of the ice_clone method.
212  *
213  * @return clone of the object
214  */
215  Ice::ObjectPtr ice_clone() const override;
216 
217  protected:
218  OperationNot();
219  };
220 }
221 
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
TermImpl.h
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::ctrlutil::a
double a(double t, double a0, double j)
Definition: CtrlUtil.h:45
armarx::OperationOr
Definition: Operations.h:124
armarx::OperationAnd
Definition: Operations.h:72
armarx::OperationNot
Definition: Operations.h:176
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
armarx::Operation
Definition: Operations.h:48
ImportExport.h
armarx::GenericFactory
Definition: FactoryCollectionBase.h:51
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
ARMARXCORE_IMPORT_EXPORT
#define ARMARXCORE_IMPORT_EXPORT
Definition: ImportExport.h:38
armarx::TermImpl
Definition: TermImpl.h:53
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28