27#ifndef PDCOM5_VARIABLE_H
28#define PDCOM5_VARIABLE_H
33#include "SizeTypeInfo.h"
35#include "pdcom5_export.h"
50class VariablePollResult;
68 friend class impl::Variable;
70 explicit Variable(std::weak_ptr<const impl::Variable> pimpl) :
71 pimpl_(std::move(pimpl))
78 std::chrono::nanoseconds>;
101 template <
typename T>
102 typename std::enable_if<!std::is_arithmetic<T>::value,
SetValueFuture>::type
108 typename std::add_lvalue_reference<
109 const typename T::value_type>::type>::value,
110 "Index operator does not return a lvalue reference of an "
114 "Container must be contiguous");
118 data.size(), selector);
132 template <
typename T>
133 typename std::enable_if<std::is_arithmetic<T>::value, SetValueFuture>::type
152 template <
typename T,
size_t M,
size_t N>
176 TypeInfo::DataType src_type,
178 const Selector &selector = {
nullptr})
const;
195 TypeInfo::DataType src_type,
197 size_t offset)
const;
244 bool empty() const noexcept {
return (pimpl_.expired()); }
270 std::weak_ptr<const impl::Variable> pimpl_;
282 std::vector<char> data_;
292 const void *getData()
const noexcept {
return data_.data(); }
293 void *getData()
noexcept {
return data_.data(); }
294 Variable getVariable()
const noexcept {
return variable_; }
Callback management handle.
Definition: Future.h:51
Size of a Variable.
Definition: SizeTypeInfo.h:67
Result of Variable::poll()
Definition: Variable.h:281
PdCom Variable interface.
Definition: Variable.h:67
SetValueFuture setValue(const void *src, TypeInfo::DataType src_type, size_t count, const Selector &selector={nullptr}) const
Write to a variable.
PdCom::Variable::SetValueFuture setValue(const void *src, TypeInfo::DataType src_type, size_t count, size_t offset) const
Write to a variable.
std::string getPath() const
The Path of the variable.
Variable()=default
Constructs an empty variable.
std::chrono::duration< double > getSampleTime() const
PollFuture poll() const
Read a variable without subscription.
TypeInfo getTypeInfo() const
Get details about the variable type.
std::enable_if<!std::is_arithmetic< T >::value, SetValueFuture >::type setValue(T const &data, const Selector &selector={nullptr}) const
Write to a variable.
Definition: Variable.h:103
std::string getName() const
The name of the variable.
SizeInfo getSizeInfo() const
Get details about the variable shape.
std::string getAlias() const
The alias of the variable, if set.
bool empty() const noexcept
Checks whether this instance is empty.
Definition: Variable.h:244
int getTaskId() const
The task id of the variable.
SetValueFuture setValue(const T(&data)[M][N], const Selector &selector={nullptr}) const
Write to a variable.
Definition: Variable.h:154
std::enable_if< std::is_arithmetic< T >::value, SetValueFuture >::type setValue(T const &data, const Selector &selector={nullptr}) const
Write to a variable.
Definition: Variable.h:134
library version string as "major.minor.patch"
Definition: ClientStatistics.h:31
Data Deserialisation helper.
Definition: DataDeserializer.h:51
Definition: Exception.h:35
Selector base class for creating views on multidimensional data.
Definition: Selector.h:48
Type of a Variable.
Definition: SizeTypeInfo.h:34
size_t element_size
Size of one element in bytes.
Definition: SizeTypeInfo.h:56
Definition: details.h:187