30#include <ArmarXCore/interface/observers/DataFieldIdentifierBase.h>
31#include <ArmarXCore/interface/observers/ObserverInterface.h>
53 template <
class BaseClass,
class VariantClass>
61 const std::string& channelName,
62 const std::string& datafieldName,
63 bool performValidation =
true);
66 const std::string& channelName,
67 const std::string& datafieldName,
68 bool performValidation =
true);
70 const std::string& datafieldName,
71 bool performValidation =
true);
78 Ice::ObjectPtr ice_clone()
const override;
80 VariantDataClassPtr clone(
const Ice::Current&
c = Ice::emptyCurrent)
const override;
81 std::string output(
const Ice::Current&
c = Ice::emptyCurrent)
const override;
82 VariantTypeId getType(
const Ice::Current&
c = Ice::emptyCurrent)
const override;
83 bool validate(
const Ice::Current&
c = Ice::emptyCurrent)
override;
108 return var->get<
T>();
111 template <
typename T>
112 typename std::enable_if_t<!std::is_base_of_v<VariantDataClass, T>,
T>
123 return var->get<
T>();
127 getBool(
const Ice::Current&
c = Ice::emptyCurrent)
const override
133 getInt(
const Ice::Current&
c = Ice::emptyCurrent)
const override
139 getLong(
const Ice::Current&
c = Ice::emptyCurrent)
const override
145 getFloat(
const Ice::Current&
c = Ice::emptyCurrent)
const override
151 getDouble(
const Ice::Current&
c = Ice::emptyCurrent)
const override
157 getString(
const Ice::Current&
c = Ice::emptyCurrent)
const override
180 stream << rhs->output();
185 void serialize(
const ObjectSerializerBasePtr& serializer,
186 const ::Ice::Current& = Ice::emptyCurrent)
const override;
187 void deserialize(
const ObjectSerializerBasePtr& serializer,
188 const ::Ice::Current& = Ice::emptyCurrent)
override;
201extern template class ::IceInternal::Handle<::armarx::DatafieldRef>;
std::ostream & operator<<(std::ostream &strm, const AbstractInterface &a)
#define ARMARXCORE_IMPORT_EXPORT
The DatafieldRef class is similar to the ChannelRef, but points to a specific Datafield instead of to...
TimedVariantPtr getDataField() const
Retrieves the value of the datafield from the Observer.
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
friend class GenericFactory
std::string getString(const Ice::Current &c=Ice::emptyCurrent) const override
int getInt(const Ice::Current &c=Ice::emptyCurrent) const override
bool getBool(const Ice::Current &c=Ice::emptyCurrent) const override
std::enable_if_t< std::is_base_of_v< VariantDataClass, T >, IceInternal::Handle< T > > get() const
long getLong(const Ice::Current &c=Ice::emptyCurrent) const override
double getDouble(const Ice::Current &c=Ice::emptyCurrent) const override
std::enable_if_t<!std::is_base_of_v< VariantDataClass, T >, T > get() const
float getFloat(const Ice::Current &c=Ice::emptyCurrent) const override
Baseclass for all ArmarX Observers.
static VariantTypeId addTypeName(const std::string &typeName)
Register a new type for the use in a Variant.
const VariantTypeId DatafieldRef
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< TimedVariant > TimedVariantPtr
IceInternal::Handle< Variant > VariantPtr
IceInternal::Handle< ChannelRef > ChannelRefPtr
IceInternal::Handle< DatafieldRef > DatafieldRefPtr
IceInternal::Handle< DataFieldIdentifier > DataFieldIdentifierPtr
Typedef of DataFieldIdentifierPtr as IceInternal::Handle<DataFieldIdentifier> for convenience.