LiteralImpl.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
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24 
25 #pragma once
26 
28 
29 #include <ArmarXCore/interface/observers/VariantBase.h>
30 #include <ArmarXCore/interface/observers/ObserverInterface.h>
31 
35 
36 #include <IceUtil/Handle.h>
37 
38 #include <memory>
39 #include <string>
40 
41 
42 namespace armarx
43 {
44  class LiteralImpl;
45 
50 
60  virtual public LiteralImplBase,
61  virtual public TermImpl
62  {
63  friend class ConditionHandler;
64  friend class Literal;
65  template <class BaseClass, class VariantClass>
66  friend class GenericFactory;
67 
68  protected:
72  LiteralImpl();
73 
74  ~LiteralImpl();
75 
83  LiteralImpl(const std::string& dataFieldIdentifierStr, const std::string& checkName, const ParameterList& checkParameters);
84 
92  LiteralImpl(const DataFieldIdentifier& dataFieldIdentifier, const std::string& checkName, const ParameterList& checkParameters);
93 
101  LiteralImpl(const DataFieldIdentifierPtr& dataFieldIdentifier, const std::string& checkName, const ParameterList& checkParameters);
102 
103  LiteralImpl(const DatafieldRefBasePtr& dataFieldIdentifier, const std::string& checkName, const ParameterList& checkParameters);
104 
105  void createInstance();
106  public:
112  CheckConfiguration getCheckConfiguration(const Ice::Current& c = Ice::emptyCurrent) override;
113 
119  void setValue(bool value, const Ice::Current& c = Ice::emptyCurrent) override;
120  void setValueAndData(bool value, const ::armarx::DataFieldIdentifierBasePtr& id, const ::armarx::VariantBasePtr& data, const Ice::Current& c = Ice::emptyCurrent) override;
121 
127  Ice::ObjectPtr ice_clone() const override;
128 
134  void output(std::ostream& out) const override;
135 
136 
140  friend std::ostream& operator<<(std::ostream& stream, const LiteralImpl& rhs)
141  {
142  rhs.output(stream);
143 
144  return stream;
145  }
146 
150  friend std::ostream& operator<<(std::ostream& stream, const LiteralImplPtr& rhs)
151  {
152  rhs->output(stream);
153 
154  return stream;
155  }
156  protected:
157  void init(const std::string& dataFieldIdentifierStr, const std::string& checkName, const ParameterList& checkParameters);
158  private:
159  void installCheck(const Ice::ObjectAdapterPtr& adapter, const ObserverInterfacePrx& proxy);
160  void removeCheck(const Ice::ObjectAdapterPtr& adapter, const ObserverInterfacePrx& proxy);
161 
162  struct Impl;
163  std::unique_ptr<Impl> impl;
164  };
165 }
166 extern template class ::IceInternal::Handle<::armarx::LiteralImpl>;
armarx::LiteralImpl
LiteralImpls are the basic elements for defining conditional expressions.
Definition: LiteralImpl.h:59
armarx::VariantBasePtr
::IceInternal::Handle<::armarx::VariantBase > VariantBasePtr
Definition: ManagedIceObject.h:109
armarx::LiteralImpl::operator<<
friend std::ostream & operator<<(std::ostream &stream, const LiteralImplPtr &rhs)
stream operator for LiteralImplPtr
Definition: LiteralImpl.h:150
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
DataFieldIdentifier.h
armarx::ConditionHandler
Definition: ConditionHandler.h:65
TermImpl.h
armarx::DataFieldIdentifierBasePtr
IceInternal::Handle< DataFieldIdentifierBase > DataFieldIdentifierBasePtr
Definition: StatechartContextInterface.h:42
IceInternal::Handle
Definition: forward_declarations.h:8
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::LiteralImpl::output
void output(std::ostream &out) const override
output to stream.
Definition: LiteralImpl.cpp:119
armarx::LiteralImpl::operator<<
friend std::ostream & operator<<(std::ostream &stream, const LiteralImpl &rhs)
stream operator for LiteralImpl
Definition: LiteralImpl.h:140
ImportExport.h
armarx::Literal
Definition: Term.h:208
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::LiteralImplPtr
IceInternal::Handle< LiteralImpl > LiteralImplPtr
Typedef of LiteralImplPtr as IceInternal::Handle<LiteralImpl> for convenience.
Definition: ConditionRoot.h:50
armarx::TermImpl
Definition: TermImpl.h:53
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