Term.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 
27 // variant includes
30 
31 // condition includes
34 
35 namespace armarx
36 {
112  {
113  public:
119  Term();
120 
126  Term(const Term& other);
127 
133  Term(TermImplPtr impl);
134 
141  Term operator&&(const Term& right) const;
142 
149  Term operator||(const Term& right) const;
150 
156  Term operator!(void) const;
157 
164  Term& operator=(const Term& right);
165 
171  TermImplPtr getImpl() const;
172 
173 
181  friend std::ostream& operator<<(std::ostream& stream, const Term& rhs)
182  {
183  // call streaming operator on implementation
184  if (rhs.termImpl)
185  {
186  stream << rhs.termImpl;
187  }
188 
189  return stream;
190  }
191 
192  protected:
193  // reference to term implementation
195  };
196 
197 
198  using VarList = std::vector<Variant>;
209  public Term
210  {
211  public:
219  Literal(const std::string& dataFieldIdentifierStr, const std::string& checkName, const VarList& checkParameters = createParameterList());
220 
221 
229  Literal(const DataFieldIdentifier& dataFieldIdentifier, const std::string& checkName, const VarList& checkParameters = createParameterList());
230 
238  Literal(const DataFieldIdentifierPtr& dataFieldIdentifier, const std::string& checkName, const VarList& checkParameters = createParameterList());
239 
240  Literal(const DatafieldRefBasePtr& datafieldRef, const std::string& checkName, const VarList& checkParameters = createParameterList());
241 
247  static VarList createParameterList();
248 
255  static VarList createParameterList(const Variant& param1);
256 
264  static VarList createParameterList(const Variant& param1, const Variant& param2);
265 
274  static VarList createParameterList(const Variant& param1, const Variant& param2, const Variant& param3);
275 
276  ParameterList toParamList(const VarList& varList) const;
277  };
278 }
279 
LiteralImpl.h
armarx::Variant
The Variant class is described here: Variants.
Definition: Variant.h:224
DataFieldIdentifier.h
TermImpl.h
armarx::Term
Definition: Term.h:111
armarx::VarList
std::vector< Variant > VarList
Definition: Term.h:198
armarx::Term::operator<<
friend std::ostream & operator<<(std::ostream &stream, const Term &rhs)
Streaming operator.
Definition: Term.h:181
IceInternal::Handle< TermImpl >
armarx::Term::termImpl
TermImplPtr termImpl
Definition: Term.h:194
armarx::Literal
Definition: Term.h:208
ARMARXCORE_IMPORT_EXPORT
#define ARMARXCORE_IMPORT_EXPORT
Definition: ImportExport.h:38
Variant.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::DataFieldIdentifier
DataFieldIdentifier provide the basis to identify data field within a distributed ArmarX scenario.
Definition: DataFieldIdentifier.h:48