32#include <boost/array.hpp>
33#include <boost/tuple/tuple.hpp>
42#ifdef ROBOTRACONTEUR_USE_SMALL_VECTOR
43#include <boost/container/small_vector.hpp>
46#include <boost/asio/buffer.hpp>
48#include <boost/utility/value_init.hpp>
49#include <boost/container/static_vector.hpp>
50#include <boost/foreach.hpp>
51#include <boost/range/adaptor/map.hpp>
52#include <boost/range/numeric.hpp>
54#include <boost/smart_ptr/intrusive_ref_counter.hpp>
56#include <boost/numeric/conversion/cast.hpp>
58#include <boost/lexical_cast.hpp>
60#include <boost/utility/string_ref.hpp>
62#include <boost/variant.hpp>
64#include <boost/date_time/posix_time/ptime.hpp>
65#include "boost/date_time/posix_time/posix_time_types.hpp"
69namespace RobotRaconteur
140ROBOTRACONTEUR_CORE_API
bool operator==(
const cdouble& c1,
const cdouble& c2);
141ROBOTRACONTEUR_CORE_API
bool operator!=(
const cdouble& c1,
const cdouble& c2);
142ROBOTRACONTEUR_CORE_API
bool operator==(
const cfloat& c1,
const cfloat& c2);
143ROBOTRACONTEUR_CORE_API
bool operator!=(
const cfloat& c1,
const cfloat& c2);
144ROBOTRACONTEUR_CORE_API
bool operator==(
const rr_bool& c1,
const rr_bool& c2);
145ROBOTRACONTEUR_CORE_API
bool operator!=(
const rr_bool& c1,
const rr_bool& c2);
147template <
typename T,
typename U>
151 static RR_SHARED_PTR<T> rr_cast(
const RR_SHARED_PTR<U>& objin)
154 return RR_SHARED_PTR<T>();
156 RR_SHARED_PTR<T> c = RR_DYNAMIC_POINTER_CAST<T>(objin);
159 throw DataTypeMismatchException(
"Data type cast error");
165 static RR_INTRUSIVE_PTR<T> rr_cast(
const RR_INTRUSIVE_PTR<U>& objin)
168 return RR_INTRUSIVE_PTR<T>();
170 RR_INTRUSIVE_PTR<T> c = RR_DYNAMIC_POINTER_CAST<T>(objin);
173 throw DataTypeMismatchException(
"Data type cast error");
181class rr_cast_support<T, T>
184 static const RR_SHARED_PTR<T>& rr_cast(
const RR_SHARED_PTR<T>& objin) {
return objin; }
186 static const RR_INTRUSIVE_PTR<T>& rr_cast(
const RR_INTRUSIVE_PTR<T>& objin) {
return objin; }
198template <
typename T,
typename U>
199static RR_SHARED_PTR<T>
rr_cast(
const RR_SHARED_PTR<U>& objin)
201 return rr_cast_support<T, U>::rr_cast(objin);
214template <
typename T,
typename U>
215static RR_INTRUSIVE_PTR<T>
rr_cast(
const RR_INTRUSIVE_PTR<U>& objin)
217 return rr_cast_support<T, U>::rr_cast(objin);
227class ROBOTRACONTEUR_CORE_API RRObject : boost::noncopyable
232 virtual ~RRObject() {}
251class ROBOTRACONTEUR_CORE_API RRValue :
public boost::intrusive_ref_counter<RRValue>, boost::noncopyable
256 virtual ~RRValue() {}
258 virtual std::string RRType() = 0;
263class ROBOTRACONTEUR_CORE_API MessageStringData
269class ROBOTRACONTEUR_CORE_API MessageStringData_string_ref
272 boost::string_ref ref;
273 MessageStringData_string_ref(
const boost::string_ref& r) : ref(r) {}
275class ROBOTRACONTEUR_CORE_API MessageStringData_static_string
278 boost::string_ref ref;
279 MessageStringData_static_string(
const boost::string_ref& r) : ref(r) {}
284class ROBOTRACONTEUR_CORE_API MessageStringRef;
286class ROBOTRACONTEUR_CORE_API MessageStringPtr
289 boost::variant<detail::MessageStringData, detail::MessageStringData_static_string> _str_ptr;
292 friend class MessageStringRef;
296 MessageStringPtr(
const std::string& str);
297 MessageStringPtr(boost::string_ref str,
bool is_static =
false);
298 MessageStringPtr(
const MessageStringPtr& str_ptr);
299 MessageStringPtr(
const MessageStringRef& str_ref);
300#ifndef ROBOTRACONTEUR_NO_CXX11
301 MessageStringPtr(std::string&& str);
305 inline MessageStringPtr(
const char (&str)[N])
307 init_literal(str, strlen(str));
310 boost::string_ref str()
const;
313 bool operator==(MessageStringRef b)
const;
314 bool operator!=(MessageStringRef b)
const;
315 bool operator<(MessageStringRef b)
const;
318 void init_literal(
const char* str,
size_t len);
321class ROBOTRACONTEUR_CORE_API MessageStringRef
324 boost::variant<
const detail::MessageStringData*, detail::MessageStringData_static_string,
325 detail::MessageStringData_string_ref>
329 friend class MessageStringPtr;
331 MessageStringRef(
const std::string& str);
332 MessageStringRef(boost::string_ref str,
bool is_static =
false);
333 MessageStringRef(
const MessageStringPtr& str_ptr);
334 MessageStringRef(
const MessageStringRef& str_ref);
338 inline MessageStringRef(
const char (&str)[N])
340 init_literal(str, strlen(str));
343 bool operator==(MessageStringRef b)
const;
344 bool operator!=(MessageStringRef b)
const;
346 boost::string_ref str()
const;
349 void init_literal(
const char* str,
size_t len);
352std::size_t hash_value(
const RobotRaconteur::MessageStringPtr& k);
354ROBOTRACONTEUR_CORE_API std::ostream& operator<<(std::ostream& out,
const MessageStringPtr& str);
355ROBOTRACONTEUR_CORE_API std::ostream& operator<<(std::ostream& out,
const MessageStringRef& str);
358inline boost::iterator_range<boost::string_ref::const_iterator> to_range(
const boost::string_ref& str)
360 return boost::iterator_range<boost::string_ref::const_iterator>(str.cbegin(), str.cend());
363inline std::string operator+(
const char* lhs, boost::string_ref rhs) {
return lhs + rhs.to_string(); }
365inline std::string operator+(
const std::string& lhs, boost::string_ref rhs) {
return lhs + rhs.to_string(); }
367inline std::string operator+(boost::string_ref lhs,
const char* rhs) {
return lhs.to_string() + rhs; }
376 virtual MessageStringPtr GetTypeString() = 0;
411ROBOTRACONTEUR_CORE_API RR_INTRUSIVE_PTR<RRArray<char> >
stringToRRArray(boost::string_ref str);
429 static RR_INTRUSIVE_PTR<T> PrePack(
const T& val) {
return val; }
431 template <
typename U>
432 static T PreUnpack(U& val)
434 return rr_cast<T>(val);
437 virtual ~RRPrimUtil(){};
439 typedef RR_INTRUSIVE_PTR<RRValue> BoxedType;
443class RRPrimUtil<RR_INTRUSIVE_PTR<T> >
447 static MessageStringPtr GetElementTypeString() {
return MessageStringPtr(
""); }
449 static boost::string_ref GetRRElementTypeString() {
return ""; }
451 static RR_INTRUSIVE_PTR<RRValue> PrePack(
const RR_INTRUSIVE_PTR<T>& val) {
return rr_cast<RRValue>(val); }
453 template <
typename U>
454 static RR_INTRUSIVE_PTR<T> PreUnpack(
const U& val)
456 return rr_cast<T>(val);
459 virtual ~RRPrimUtil(){};
461 typedef RR_INTRUSIVE_PTR<T> BoxedType;
465class RRPrimUtil<std::string>
469 static MessageStringPtr GetElementTypeString() {
return MessageStringPtr(
""); }
470 static boost::string_ref GetRRElementTypeString() {
return ""; }
471 static RR_INTRUSIVE_PTR<RRValue> PrePack(boost::string_ref val) {
return rr_cast<RRValue>(
stringToRRArray(val)); }
472 static std::string PreUnpack(
const RR_INTRUSIVE_PTR<RRValue>& val)
477 virtual ~RRPrimUtil(){};
479 typedef RR_INTRUSIVE_PTR<RRArray<char> > BoxedType;
482#define RRPrimUtilNumeric(x, code) \
484 class RRPrimUtil<x> \
487 static DataTypes GetTypeID() { return code; } \
488 static MessageStringPtr GetElementTypeString() { return MessageStringPtr(""); } \
489 static boost::string_ref GetRRElementTypeString() { return ""; } \
490 static RR_INTRUSIVE_PTR<RRArray<x> > PrePack(const x& val) { return ScalarToRRArray(val); } \
491 template <typename U> \
492 static x PreUnpack(const U& val) \
494 return RRArrayToScalar(rr_cast<RRArray<x> >(val)); \
496 typedef RR_INTRUSIVE_PTR<RRArray<x> > BoxedType; \
515ROBOTRACONTEUR_CORE_API std::string GetRRDataTypeString(
DataTypes type);
516ROBOTRACONTEUR_CORE_API
bool IsTypeRRArray(
DataTypes type);
517ROBOTRACONTEUR_CORE_API
bool IsTypeNumeric(
DataTypes type);
530 RR_OVIRTUAL MessageStringPtr GetTypeString() RR_OVERRIDE
532 std::string type = GetRRDataTypeString(GetTypeID());
545 RR_OVIRTUAL std::string RRType() RR_OVERRIDE;
583 RR_OVIRTUAL
DataTypes GetTypeID() RR_OVERRIDE {
return RRPrimUtil<T>::GetTypeID(); }
585 RRArray(T*
data,
size_t length,
bool owned) : data_(
data), element_count(length), owned(owned) {}
587 RR_OVIRTUAL ~RRArray() RR_OVERRIDE
595 T* operator->()
const {
return data; }
597 RR_OVIRTUAL
size_t size() RR_OVERRIDE {
return element_count; }
599 RR_OVIRTUAL
size_t ElementSize() RR_OVERRIDE {
return sizeof(T); }
657 BOOST_ASSERT_MSG(i < element_count,
"out of range");
664 BOOST_ASSERT_MSG(i < element_count,
"out of range");
699 const T*
data()
const {
return data_; }
703 T* c_array() {
return data_; }
712 template <
typename T2>
734 void rangecheck(size_type i)
738 std::out_of_range e(
"array<>: index out of range");
739 boost::throw_exception(e);
745 size_t element_count;
753 static boost::string_ref get()
755 BOOST_STATIC_ASSERT_MSG(
sizeof(T) == 0,
"Invalid key type for Robot Raconteur map");
756 throw DataTypeException(
"Unknown data type");
759 static std::string get_map_rrtype()
761 BOOST_STATIC_ASSERT_MSG(
sizeof(T) == 0,
"Invalid key type for Robot Raconteur map");
762 throw DataTypeException(
"Unknown data type");
767class RRMap_keytype<int32_t>
770 static boost::string_ref get() {
return "int32_t"; }
772 static std::string get_map_rrtype() {
return "RobotRaconteur.RRMap<int32_t>"; }
776class RRMap_keytype<std::string>
779 static boost::string_ref get() {
return "string"; }
781 static std::string get_map_rrtype() {
return "RobotRaconteur.RRMap<string>"; }
794template <
typename K,
typename T>
795class RRMap :
public RRValue
798 std::map<K, RR_INTRUSIVE_PTR<T> > map;
803 RRMap(
const std::map<K, RR_INTRUSIVE_PTR<T> >& mapin) : map(mapin) {}
805 RR_OVIRTUAL ~RRMap() RR_OVERRIDE {}
807 RR_OVIRTUAL std::string RRType() RR_OVERRIDE {
return RRMap_keytype<K>::get_map_rrtype(); }
861 bool empty()
const {
return map.empty(); }
878 return map.insert(x);
881 template <
class InputIterator>
882 void insert(InputIterator first, InputIterator last)
884 map.insert(first, last);
921class RRList :
public RRValue
924 std::list<RR_INTRUSIVE_PTR<T> > list;
929 RRList(std::list<RR_INTRUSIVE_PTR<T> > listin) { list = listin; }
931 RR_OVIRTUAL ~RRList() RR_OVERRIDE {}
933 RR_OVIRTUAL std::string RRType() RR_OVERRIDE {
return "RobotRaconteur.RRList"; }
987 bool empty()
const {
return list.empty(); }
1001 void push_front(
const RR_INTRUSIVE_PTR<T>& x) { list.push_front(x); }
1003 void push_back(
const RR_INTRUSIVE_PTR<T>& x) { list.push_back(x); }
1017 void remove(
const RR_INTRUSIVE_PTR<T>& value) { list.remove(value); }
1058template <
typename T>
1061 return RR_INTRUSIVE_PTR<RRArray<T> >(
new RRArray<T>(
new T[length], length,
true));
1082template <
typename T>
1083static RR_INTRUSIVE_PTR<RRArray<T> >
AttachRRArray(T* data,
size_t length,
bool owned)
1085 return RR_INTRUSIVE_PTR<RRArray<T> >(
new RRArray<T>(data, length, owned));
1100template <
typename T>
1103 RR_INTRUSIVE_PTR<RRArray<T> > ret(
new RRArray<T>(
new T[length], length,
true));
1104 memcpy(ret->void_ptr(), data, length *
sizeof(T));
1141template <
typename T>
1147 memset(
static_cast<void*
>(o->data()), 0, length *
sizeof(T));
1174template <
typename T>
1187template <
typename T>
1195 if (value->size() == 0)
1214template <
typename Y,
typename U>
1219 std::vector<Y> out(in->size());
1220 for (
size_t i = 0; i < in->size(); i++)
1221 out[i] = boost::numeric_cast<Y>((*in)[i]);
1236template <
typename Y,
typename U>
1240 for (
size_t i = 0; i < in.size(); i++)
1241 (*out)[i] = boost::numeric_cast<Y>(in[i]);
1257template <
typename Y, std::
size_t N,
typename U>
1262 if (in->size() != N)
1264 boost::array<Y, N> out = {};
1265 for (
size_t i = 0; i < N; i++)
1266 out[i] = boost::numeric_cast<Y>((*in)[i]);
1281template <
typename Y, std::
size_t N,
typename U>
1286 if (in->size() != N)
1288 for (
size_t i = 0; i < N; i++)
1289 out[i] = boost::numeric_cast<Y>((*in)[i]);
1304template <
typename Y,
typename U, std::
size_t N>
1308 for (
size_t i = 0; i < N; i++)
1309 (*out)[i] = boost::numeric_cast<Y>(in[i]);
1327template <
typename Y, std::
size_t N,
typename U>
1334 boost::container::static_vector<Y, N> out(in->size());
1335 for (
size_t i = 0; i < in->size(); i++)
1336 out[i] = boost::numeric_cast<Y>((*in)[i]);
1354template <
typename Y, std::
size_t N,
typename U>
1361 out.resize(in->size());
1362 for (
size_t i = 0; i < in->size(); i++)
1363 out[i] = boost::numeric_cast<Y>((*in)[i]);
1380template <
typename Y,
typename U, std::
size_t N>
1384 for (
size_t i = 0; i < in.size(); i++)
1385 (*out)[i] = boost::numeric_cast<Y>(in[i]);
1398 const std::vector<std::string>& string_vector);
1422template <
typename T>
1445template <
typename T>
1466template <
typename T>
1489template <
typename T>
1490const RR_INTRUSIVE_PTR<T>&
rr_null_check(
const RR_INTRUSIVE_PTR<T>& ptr,
const char* msg)
1499#define RR_NULL_CHECK rr_null_check
1501template <
typename T>
1502static RR_INTRUSIVE_PTR<RRArray<T> > VerifyRRArrayLength(
const RR_INTRUSIVE_PTR<RRArray<T> >& a,
size_t len,
1506 throw NullValueException(
"Arrays must not be null");
1509 if (varlength && (a->size() > len))
1511 throw DataTypeException(
"Array dimension mismatch");
1513 if (!varlength && (a->size() != len))
1515 throw DataTypeException(
"Array dimension mismatch");
1521template <
typename T>
1522static RR_INTRUSIVE_PTR<RRList<T> > VerifyRRArrayLength(
const RR_INTRUSIVE_PTR<RRList<T> >& a,
size_t len,
1527 BOOST_FOREACH (RR_INTRUSIVE_PTR<T>& aa, (*a))
1529 VerifyRRArrayLength(aa, len, varlength);
1534template <
typename K,
typename T>
1535static RR_INTRUSIVE_PTR<RRMap<K, T> > VerifyRRArrayLength(
const RR_INTRUSIVE_PTR<RRMap<K, T> >& a,
size_t len,
1540 BOOST_FOREACH (
const RR_INTRUSIVE_PTR<T>& aa, *a | boost::adaptors::map_values)
1542 VerifyRRArrayLength(aa, len, varlength);
1559 virtual DataTypes GetElementTypeID() = 0;
1564ROBOTRACONTEUR_CORE_API
class MultiDimArray_CalculateCopyIndicesIter
1567 virtual bool Next(uint32_t& indexa, uint32_t& indexb, uint32_t& len) = 0;
1569 virtual ~MultiDimArray_CalculateCopyIndicesIter();
1573ROBOTRACONTEUR_CORE_API RR_SHARED_PTR<MultiDimArray_CalculateCopyIndicesIter>
1574MultiDimArray_CalculateCopyIndicesBeginIter(
const std::vector<uint32_t>& mema_dims,
1575 const std::vector<uint32_t>& mema_pos,
1576 const std::vector<uint32_t>& memb_dims,
1577 const std::vector<uint32_t>& memb_pos,
const std::vector<uint32_t>& count);
1600template <
typename T>
1604 RR_INTRUSIVE_PTR<RRArray<uint32_t> > Dims;
1606 RR_INTRUSIVE_PTR<RRArray<T> > Array;
1608 RRMultiDimArray(){};
1613 this->Array = Array;
1616 RR_OVIRTUAL ~RRMultiDimArray() RR_OVERRIDE {}
1618 RR_OVIRTUAL std::string RRType() RR_OVERRIDE {
return "RobotRaconteur.RRMultiDimArray"; }
1620 RR_OVIRTUAL
DataTypes GetElementTypeID() RR_OVERRIDE {
return RRPrimUtil<T>::GetTypeID(); }
1631 const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& buffer,
1632 const std::vector<uint32_t>& bufferpos,
const std::vector<uint32_t>& count)
1637 RR_SHARED_PTR<detail::MultiDimArray_CalculateCopyIndicesIter> iter =
1638 detail::MultiDimArray_CalculateCopyIndicesBeginIter(mema_dims, memorypos, memb_dims, bufferpos, count);
1641 uint32_t indexa = 0;
1642 uint32_t indexb = 0;
1644 while (iter->Next(indexa, indexb, len))
1646 memcpy((buffer->Array->data() + indexb), (Array->data()) + indexa, len *
sizeof(T));
1659 const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& buffer,
1660 const std::vector<uint32_t>& bufferpos,
const std::vector<uint32_t>& count)
1665 RR_SHARED_PTR<detail::MultiDimArray_CalculateCopyIndicesIter> iter =
1666 detail::MultiDimArray_CalculateCopyIndicesBeginIter(mema_dims, memorypos, memb_dims, bufferpos, count);
1669 uint32_t indexa = 0;
1670 uint32_t indexb = 0;
1672 while (iter->Next(indexa, indexb, len))
1674 memcpy((Array->data() + indexa), (buffer->Array->data() + indexb), len *
sizeof(T));
1679template <
size_t Ndims,
typename T>
1680static RR_INTRUSIVE_PTR<RRMultiDimArray<T> > VerifyRRMultiDimArrayLength(
const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& a,
1682 const boost::array<uint32_t, Ndims>& dims)
1685 throw NullValueException(
"Arrays must not be null");
1687 if (a->Dims->size() != Ndims)
1689 throw DataTypeException(
"Array dimension mismatch");
1692 if (a->Array->size() != n_elems)
1694 throw DataTypeException(
"Array dimension mismatch");
1697 for (
size_t i = 0; i < Ndims; i++)
1699 if ((*a->Dims)[i] != dims[i])
1701 throw DataTypeException(
"Array dimension mismatch");
1708template <
size_t Ndims,
typename T>
1709static RR_INTRUSIVE_PTR<RRList<T> > VerifyRRMultiDimArrayLength(
const RR_INTRUSIVE_PTR<RRList<T> >& a,
size_t n_elems,
1710 const boost::array<uint32_t, Ndims>& dims)
1719 BOOST_FOREACH (
const RR_INTRUSIVE_PTR<T>& aa, (*a))
1721 VerifyRRMultiDimArrayLength<Ndims>(aa, n_elems, dims);
1727template <
size_t Ndims,
typename K,
typename T>
1728static RR_INTRUSIVE_PTR<RRMap<K, T> > VerifyRRMultiDimArrayLength(
const RR_INTRUSIVE_PTR<RRMap<K, T> >& a,
1730 const boost::array<uint32_t, Ndims>& dims)
1739 BOOST_FOREACH (
const RR_INTRUSIVE_PTR<T>& aa, *a | boost::adaptors::map_values)
1741 VerifyRRMultiDimArrayLength<Ndims>(aa, n_elems, dims);
1757template <
typename T>
1760 uint32_t n_elems = boost::accumulate(dims, 1, std::multiplies<uint32_t>());
1770template <
typename T>
1773 std::vector<uint32_t> length;
1774 length.push_back(0);
1788template <
typename T>
1801template <
typename T>
1815template <
typename T,
typename U>
1828template <
typename K,
typename T>
1843template <
typename K,
typename T,
typename U>
1870 virtual boost::string_ref RRElementTypeString() = 0;
1887template <
typename T>
1891 typename std::vector<T> pod_array;
1894 RRPodArray(
size_t n) { pod_array.resize(n); }
1896 RRPodArray(
typename std::vector<T>& array_in) : pod_array(array_in) {}
1898 RRPodArray(
const T& value_in) { pod_array.push_back(value_in); }
1900 RR_OVIRTUAL ~RRPodArray() RR_OVERRIDE {}
1902 RR_OVIRTUAL std::string RRType() RR_OVERRIDE {
return "RobotRaconteur.RRPodArray"; }
1904 RR_OVIRTUAL boost::string_ref RRElementTypeString() RR_OVERRIDE {
return RRPrimUtil<T>::GetRRElementTypeString(); }
1954 bool empty()
const {
return pod_array.empty(); }
1976 T*
data() {
return pod_array.data(); }
1978 const T*
data()
const {
return pod_array.data(); }
1990#define RRPrimUtilPod(x, type_string) \
1992 class RRPrimUtil<x> \
1995 static DataTypes GetTypeID() { return DataTypes_pod_t; } \
1996 static MessageStringPtr GetElementTypeString() { return MessageStringPtr(type_string); } \
1997 static boost::string_ref GetRRElementTypeString() { return type_string; } \
1998 static RR_INTRUSIVE_PTR<RRPodArray<x> > PrePack(const x& val) { return ScalarToRRPodArray(val); } \
1999 template <typename U> \
2000 static x PreUnpack(const U& val) \
2002 return RRPodArrayToScalar(rr_cast<RRPodArray<x> >(val)); \
2004 typedef RR_INTRUSIVE_PTR<RRPodArray<x> > BoxedType; \
2017 RR_INTRUSIVE_PTR<RRArray<uint32_t> > Dims;
2018 virtual boost::string_ref RRElementTypeString() = 0;
2040template <
typename T>
2044 typename RR_INTRUSIVE_PTR<RRPodArray<T> > PodArray;
2046 RRPodMultiDimArray() {}
2054 RR_OVIRTUAL ~RRPodMultiDimArray() RR_OVERRIDE {}
2056 RR_OVIRTUAL std::string RRType() RR_OVERRIDE {
return "RobotRaconteur.RRPodMultiDimArray"; }
2058 RR_OVIRTUAL boost::string_ref RRElementTypeString() RR_OVERRIDE {
return RRPrimUtil<T>::GetRRElementTypeString(); }
2069 const RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& buffer,
2070 const std::vector<uint32_t>& bufferpos,
const std::vector<uint32_t>& count)
2075 RR_SHARED_PTR<detail::MultiDimArray_CalculateCopyIndicesIter> iter =
2076 detail::MultiDimArray_CalculateCopyIndicesBeginIter(mema_dims, memorypos, memb_dims, bufferpos, count);
2079 uint32_t indexa = 0;
2080 uint32_t indexb = 0;
2082 while (iter->Next(indexa, indexb, len))
2084 for (
size_t i = 0; i < len; i++)
2086 buffer->PodArray->at(indexb + i) = PodArray->at(indexa + i);
2100 const RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& buffer,
2101 const std::vector<uint32_t>& bufferpos,
const std::vector<uint32_t>& count)
2106 RR_SHARED_PTR<detail::MultiDimArray_CalculateCopyIndicesIter> iter =
2107 detail::MultiDimArray_CalculateCopyIndicesBeginIter(mema_dims, memorypos, memb_dims, bufferpos, count);
2110 uint32_t indexa = 0;
2111 uint32_t indexb = 0;
2113 while (iter->Next(indexa, indexb, len))
2115 for (
size_t i = 0; i < len; i++)
2117 PodArray->at(indexa + i) = buffer->PodArray->at(indexb + i);
2130template <
typename T>
2143template <
typename T>
2151 if (value->size() == 0)
2154 return value->at(0);
2170template <
typename T>
2189template <
typename T>
2192 uint32_t n_elems = boost::accumulate(dims, 1, std::multiplies<uint32_t>());
2206template <
typename T>
2209 std::vector<uint32_t> length;
2210 length.push_back(0);
2214#define RRPrimUtilNamedArray(x, type_string, array_type) \
2216 class RRPrimUtil<x> \
2219 static DataTypes GetTypeID() { return DataTypes_pod_t; } \
2220 static MessageStringPtr GetElementTypeString() { return MessageStringPtr(type_string); } \
2221 static boost::string_ref GetRRElementTypeString() { return type_string; } \
2222 static RR_INTRUSIVE_PTR<RRNamedArray<x> > PrePack(const x& val) { return ScalarToRRNamedArray(val); } \
2223 template <typename U> \
2224 static x PreUnpack(const U& val) \
2226 return RRNamedArrayToScalar(rr_cast<RRNamedArray<x> >(val)); \
2228 typedef RR_INTRUSIVE_PTR<RRNamedArray<x> > BoxedType; \
2229 typedef array_type ElementArrayType; \
2230 static const size_t ElementArrayCount = sizeof(x) / sizeof(array_type); \
2231 static size_t GetElementArrayCount() { return ElementArrayCount; } \
2232 static DataTypes GetElementArrayTypeID() { return RRPrimUtil<array_type>::GetTypeID(); } \
2244 virtual DataTypes ElementArrayType() = 0;
2246 virtual size_t ElementSize() = 0;
2248 virtual size_t ElementArrayCount() = 0;
2250 virtual RR_INTRUSIVE_PTR<RRBaseArray> GetNumericBaseArray() = 0;
2252 virtual boost::string_ref RRElementTypeString() = 0;
2269template <
typename T>
2273 RR_INTRUSIVE_PTR<RRArray<typename RRPrimUtil<T>::ElementArrayType> > rr_array;
2292 this->rr_array = rr_array;
2295 virtual DataTypes GetTypeID() {
return RRPrimUtil<T>::GetTypeID(); }
2297 virtual size_t size()
const {
return rr_array->size() / (RRPrimUtil<T>::ElementArrayCount); }
2299 virtual size_t size() {
return rr_array->size() / (RRPrimUtil<T>::ElementArrayCount); }
2301 virtual void*
void_ptr() {
return rr_array->void_ptr(); }
2309 virtual RR_INTRUSIVE_PTR<RRArray<typename RRPrimUtil<T>::ElementArrayType> >
GetNumericArray() {
return rr_array; }
2313 RR_OVIRTUAL std::string RRType() RR_OVERRIDE {
return "RobotRaconteur.RRNamedArray"; }
2315 RR_OVIRTUAL boost::string_ref RRElementTypeString() RR_OVERRIDE {
return RRPrimUtil<T>::GetRRElementTypeString(); }
2373 BOOST_ASSERT_MSG(i <
size(),
"out of range");
2374 return (
static_cast<T*
>(rr_array->void_ptr())[i]);
2380 BOOST_ASSERT_MSG(i <
size(),
"out of range");
2381 return (
static_cast<T*
>(rr_array->void_ptr())[i]);
2388 return (
static_cast<T*
>(rr_array->void_ptr())[i]);
2394 (
static_cast<T*
>(rr_array->void_ptr())[i]);
2408 bool empty() {
return rr_array->empty(); }
2412 void rangecheck(size_type i)
2416 std::out_of_range e(
"array<>: index out of range");
2417 boost::throw_exception(e);
2432 RR_INTRUSIVE_PTR<RRArray<uint32_t> > Dims;
2433 virtual boost::string_ref RRElementTypeString() = 0;
2455template <
typename T>
2459 typename RR_INTRUSIVE_PTR<RRNamedArray<T> > NamedArray;
2461 RRNamedMultiDimArray() {}
2466 this->NamedArray = a;
2469 RR_OVIRTUAL ~RRNamedMultiDimArray() RR_OVERRIDE {}
2471 RR_OVIRTUAL std::string RRType() RR_OVERRIDE {
return "RobotRaconteur.RRNamedMultiDimArray"; }
2473 RR_OVIRTUAL boost::string_ref RRElementTypeString() RR_OVERRIDE {
return RRPrimUtil<T>::GetRRElementTypeString(); }
2484 const RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& buffer,
2485 const std::vector<uint32_t>& bufferpos,
const std::vector<uint32_t>& count)
2490 RR_SHARED_PTR<detail::MultiDimArray_CalculateCopyIndicesIter> iter =
2491 detail::MultiDimArray_CalculateCopyIndicesBeginIter(mema_dims, memorypos, memb_dims, bufferpos, count);
2494 uint32_t indexa = 0;
2495 uint32_t indexb = 0;
2497 while (iter->Next(indexa, indexb, len))
2499 for (
size_t i = 0; i < len; i++)
2501 (*buffer->NamedArray)[(indexb + i)] = (*NamedArray)[(indexa + i)];
2515 const RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& buffer,
2516 const std::vector<uint32_t>& bufferpos,
const std::vector<uint32_t>& count)
2521 RR_SHARED_PTR<detail::MultiDimArray_CalculateCopyIndicesIter> iter =
2522 detail::MultiDimArray_CalculateCopyIndicesBeginIter(mema_dims, memorypos, memb_dims, bufferpos, count);
2525 uint32_t indexa = 0;
2526 uint32_t indexb = 0;
2528 while (iter->Next(indexa, indexb, len))
2530 for (
size_t i = 0; i < len; i++)
2532 (*NamedArray)[(indexa + i)] = (*buffer->NamedArray)[(indexb + i)];
2551template <
typename T>
2554 typedef typename RRPrimUtil<T>::ElementArrayType a_type;
2572template <
typename T>
2575 uint32_t n_elems = boost::accumulate(dims, 1, std::multiplies<uint32_t>());
2589template <
typename T>
2592 std::vector<uint32_t> length;
2593 length.push_back(0);
2607template <
typename T>
2625template <
typename T>
2633 if (value->size() == 0)
2639#define RRPrimUtilEnum(x) \
2641 class RRPrimUtil<x> \
2644 static DataTypes GetTypeID() { return DataTypes_enum_t; } \
2645 static MessageStringPtr GetElementTypeString() { return MessageStringPtr(""); } \
2646 static boost::string_ref GetRRElementTypeString() { return ""; } \
2647 static RR_INTRUSIVE_PTR<RRArray<int32_t> > PrePack(const x& val) { return ScalarToRRArray((int32_t)val); } \
2648 template <typename U> \
2649 static x PreUnpack(const U& val) \
2651 return (x)RRArrayToScalar(rr_cast<RRArray<int32_t> >(val)); \
2653 typedef RR_INTRUSIVE_PTR<RRArray<int32_t> > BoxedType; \
2656class ROBOTRACONTEUR_CORE_API RobotRaconteurNode;
2723#ifdef ROBOTRACONTEUR_USE_SMALL_VECTOR
2724typedef boost::container::small_vector<boost::asio::const_buffer, 4> const_buffers;
2725typedef boost::container::small_vector<boost::asio::mutable_buffer, 4> mutable_buffers;
2727typedef std::vector<boost::asio::const_buffer> const_buffers;
2728typedef std::vector<boost::asio::mutable_buffer> mutable_buffers;
2731template <
typename BufferSequence>
2732void buffers_consume(BufferSequence& b,
size_t count)
2734 typename BufferSequence::iterator e = b.begin();
2736 typename BufferSequence::iterator end = b.end();
2741 if (count > boost::asio::buffer_size(*e))
2743 count -= boost::asio::buffer_size(*e);
2760template <
typename BufferSequence>
2761BufferSequence buffers_consume_copy(BufferSequence& b,
size_t count)
2764 typename BufferSequence::iterator e = b.begin();
2766 typename BufferSequence::iterator end = b.end();
2767 for (; e != end; e++)
2771 if (count > boost::asio::buffer_size(*e))
2773 count -= boost::asio::buffer_size(*e);
2777 o.push_back(*e + count);
2790template <
typename BufferSequence>
2791BufferSequence buffers_consume_copy(
const BufferSequence& b,
size_t count)
2794 typename BufferSequence::const_iterator e = b.begin();
2796 typename BufferSequence::const_iterator end = b.end();
2797 for (; e != end; e++)
2801 if (count > boost::asio::buffer_size(*e))
2803 count -= boost::asio::buffer_size(*e);
2807 o.push_back(*e + count);
2820template <
typename BufferSequence>
2821BufferSequence buffers_truncate(BufferSequence& b,
size_t count)
2824 typename BufferSequence::iterator e = b.begin();
2826 typename BufferSequence::iterator end = b.end();
2828 for (; e != end; e++)
2830 if (p + boost::asio::buffer_size(*e) <= count)
2833 p += boost::asio::buffer_size(*e);
2837 o.push_back(boost::asio::buffer(*e, count - p));
2845template <
typename BufferSequence>
2846BufferSequence buffers_truncate(
const BufferSequence& b,
size_t count)
2849 typename BufferSequence::const_iterator e = b.begin();
2851 typename BufferSequence::const_iterator end = b.end();
2853 for (; e != end; e++)
2855 if (p + boost::asio::buffer_size(*e) <= count)
2858 p += boost::asio::buffer_size(*e);
2862 o.push_back(boost::asio::buffer(*e, count - p));
2873struct ROBOTRACONTEUR_CORE_API ServicePathSegment
2876 ServicePathSegment();
2878 ServicePathSegment(
const std::string& name,
2879 const boost::optional<std::string>& index = boost::optional<std::string>());
2884 boost::optional<std::string> index;
2887ROBOTRACONTEUR_CORE_API
bool operator==(
const ServicePathSegment& lhs,
const ServicePathSegment& rhs);
2889ROBOTRACONTEUR_CORE_API
bool operator!=(
const ServicePathSegment& lhs,
const ServicePathSegment& rhs);
2913ROBOTRACONTEUR_CORE_API std::vector<ServicePathSegment>
ParseServicePath(
const std::string& path);
2921ROBOTRACONTEUR_CORE_API std::string
BuildServicePath(
const std::vector<ServicePathSegment>& segments);
2954ROBOTRACONTEUR_CORE_API std::string encode_index(boost::string_ref index);
2956ROBOTRACONTEUR_CORE_API std::string decode_index(boost::string_ref index);
2958template <
typename T,
typename U>
2959bool try_convert_string_to_number(
const U& arg, T& result)
2961 if (boost::conversion::try_lexical_convert(arg, result))
2966 if (!boost::is_integral<T>::value)
2971 boost::regex hex_regex(
"^[+\\-]?0x[\\da-fA-F]+$");
2972 if (!boost::regex_match(arg.begin(), arg.end(), hex_regex))
2977 std::stringstream ss;
2978 ss << std::hex << arg;
2981 if (ss.fail() || !ss.eof())
2993#ifndef ROBOTRACONTEUR_NO_CXX11_TEMPLATE_ALIASES
3011template <
typename T>
3014template <
typename T>
3017template <
typename K,
typename T>
3020template <
typename K,
typename T>
3023template <
typename T>
3026template <
typename T>
3037template <
typename T>
3040template <
typename T>
3047template <
typename T>
3050template <
typename T>
3057template <
typename T>
3060template <
typename T>
3067template <
typename T>
3070template <
typename T>
3077template <
typename T>
3080template <
typename T>
boost::intrusive_ptr< RRMap< K, T > > AllocateEmptyRRMap()
Allocate an empty RRMap.
Definition DataTypes.h:1829
static T RRNamedArrayToScalar(const boost::intrusive_ptr< RRNamedArray< T > > &value)
Convert a namedarray array with one element into a namedarray.
Definition DataTypes.h:2626
boost::intrusive_ptr< RRArray< char > > stringToRRArray(boost::string_ref str)
Convert a string to an array of characters.
static boost::intrusive_ptr< RRPodArray< T > > AllocateEmptyRRPodArray(size_t length)
Allocate a pod array with the specified type and length and initialize to zero.
Definition DataTypes.h:2171
static boost::intrusive_ptr< RRArray< Y > > VectorToRRArray(const std::vector< U > &in)
Convert a std::vector to an RRArray<Y>.
Definition DataTypes.h:1237
boost::shared_ptr< const RRObject > RRObjectConstPtr
Convenience alias for RRObject const shared_ptr.
Definition DataTypes.h:2997
boost::intrusive_ptr< RRList< T > > RRListPtr
Convenience alias for RRList intrusive_ptr.
Definition DataTypes.h:3024
boost::intrusive_ptr< RRPodBaseMultiDimArray > RRPodBaseMultiDimArrayPtr
Convenience alias for RRPodBaseMultiDimArray intrusive_ptr.
Definition DataTypes.h:3053
boost::intrusive_ptr< T > & rr_null_check(boost::intrusive_ptr< T > &ptr)
Checks if a value RR_INTRUSIVE_PTR is null.
Definition DataTypes.h:1423
static boost::intrusive_ptr< RRArray< Y > > ArrayToRRArray(boost::array< U, N > in)
Convert a boost::array to an RRArray.
Definition DataTypes.h:1305
static T RRArrayToScalar(const boost::intrusive_ptr< RRArray< T > > &value)
Convert an array with one element into a scalar.
Definition DataTypes.h:1188
boost::intrusive_ptr< RRMap< K, T > > RRMapPtr
Convenience alias for RRMap intrusive_ptr.
Definition DataTypes.h:3018
static boost::intrusive_ptr< RRArray< T > > AttachRRArrayCopy(const T *data, const size_t length)
Allocates an array object and copies existing numeric.
Definition DataTypes.h:1101
boost::intrusive_ptr< const RRList< T > > RRListConstPtr
Convenience alias for RRList const intrusive_ptr.
Definition DataTypes.h:3027
boost::intrusive_ptr< RRPodBaseArray > RRPodBaseArrayPtr
Convenience alias for RRPodBaseArray intrusive_ptr.
Definition DataTypes.h:3043
static boost::shared_ptr< T > rr_cast(const boost::shared_ptr< U > &objin)
Dynamic cast a RR_SHARED_PTR type. Throws DataTypeMismatchException if cast is invalid instead of ret...
Definition DataTypes.h:199
boost::intrusive_ptr< RRPodArray< T > > RRPodArrayPtr
Convenience alias for RRPodArray intrusive_ptr.
Definition DataTypes.h:3048
size_t RRArrayElementSize(DataTypes type)
Get the number of bytes to store a numeric primitive scalar.
static boost::intrusive_ptr< RRPodMultiDimArray< T > > AllocateEmptyRRPodMultiDimArray(const std::vector< uint32_t > &dims)
Allocate an empty multidimensional pod array with the specified dimensions.
Definition DataTypes.h:2190
static boost::intrusive_ptr< RRArray< T > > ScalarToRRArray(T value)
Convert a scalar number into an array with one element.
Definition DataTypes.h:1175
boost::intrusive_ptr< const MessageElementData > MessageElementDataConstPtr
Convenience alias for MessageElementData const intrusive_ptr.
Definition DataTypes.h:3005
std::vector< ServicePathSegment > ParseServicePath(const std::string &path)
Parse a Robot Raconteur service path into segments.
boost::intrusive_ptr< const RRNamedBaseMultiDimArray > RRNamedBaseMultiDimBaseArrayConstPtr
Convenience alias for RRNamedBaseMultiDimArray const intrusive_ptr.
Definition DataTypes.h:3075
boost::intrusive_ptr< MessageElementData > MessageElementDataPtr
Convenience alias for MessageElementData intrusive_ptr.
Definition DataTypes.h:3003
bool IsStringIdentifier(boost::string_ref str)
Test if a string is a Robot Raconteur identifier.
boost::intrusive_ptr< RRValue > RRValuePtr
Convenience alias for RRValue intrusive_ptr.
Definition DataTypes.h:2999
boost::posix_time::ptime TimeSpecToPTime(const TimeSpec &ts)
Convert a TimeSpec into a boost::posix_time::ptime.
boost::intrusive_ptr< const RRPodMultiDimArray< T > > RRPodMultiDimArrayConstPtr
Convenience alias for RRPodMultiDimArray const intrusive_ptr.
Definition DataTypes.h:3061
static boost::intrusive_ptr< RRPodArray< T > > ScalarToRRPodArray(const T &value)
Convert a scalar pod into a pod array with one element.
Definition DataTypes.h:2131
boost::intrusive_ptr< RRList< T > > AllocateRRList(const U &c)
Allocate RRList with a value.
Definition DataTypes.h:1816
std::string RRArrayToString(const boost::intrusive_ptr< RRArray< char > > &arr)
Convert an array of characters into std::string.
TimeSpec ptimeToTimeSpec(const boost::posix_time::ptime &t)
Convert a boost::posix_time::ptime into a TimeSpec.
static T RRPodArrayToScalar(const boost::intrusive_ptr< RRPodArray< T > > &value)
Convert a pod array with one element into a scalar pod.
Definition DataTypes.h:2144
boost::intrusive_ptr< RRList< RRArray< char > > > stringVectorToRRList(const std::vector< std::string > &string_vector)
Convert a string vector to a RRList.
boost::intrusive_ptr< RRPodMultiDimArray< T > > RRPodMultiDimArrayPtr
Convenience alias for RRPodMultiDimArray intrusive_ptr.
Definition DataTypes.h:3058
boost::intrusive_ptr< const RRPodArray< T > > RRPodArrayConstPtr
Convenience alias for RRPodArray const intrusive_ptr.
Definition DataTypes.h:3051
boost::intrusive_ptr< const RRPodBaseMultiDimArray > RRPodBaseMultiDimBaseArrayConstPtr
Convenience alias for RRPodBaseMultiDimArray const intrusive_ptr.
Definition DataTypes.h:3055
boost::intrusive_ptr< const RRNamedBaseArray > RRNamedBaseArrayConstPtr
Convenience alias for RRNamedBaseArray const intrusive_ptr.
Definition DataTypes.h:3065
static boost::intrusive_ptr< RRArray< T > > AllocateEmptyRRArray(size_t length)
Allocate a numeric primitive or character array with the specified type and length and initialize to ...
Definition DataTypes.h:1142
boost::shared_ptr< RRObject > RRObjectPtr
Convenience alias for RRObject shared_ptr.
Definition DataTypes.h:2995
boost::intrusive_ptr< RRNamedArray< T > > RRNamedArrayPtr
Convenience alias for RRNamedArray intrusive_ptr.
Definition DataTypes.h:3068
boost::intrusive_ptr< const RRMultiDimArray< T > > RRMultiDimArrayConstPtr
Convenience alias for RRMultiDimArray const intrusive_ptr.
Definition DataTypes.h:3041
static boost::intrusive_ptr< RRNamedArray< T > > AllocateEmptyRRNamedArray(size_t length)
Allocate a namedarray array with the specified type and length and initialize to zero.
Definition DataTypes.h:2552
std::vector< std::string > RRListToStringVector(const boost::intrusive_ptr< RRList< RRArray< char > > > &list)
Convert a RRList containing strings to a string vector.
boost::intrusive_ptr< RRMultiDimBaseArray > RRMultiDimBaseArrayPtr
Convenience alias for RRMultiDimBaseArray intrusive_ptr.
Definition DataTypes.h:3033
static boost::intrusive_ptr< RRArray< T > > AllocateRRArray(size_t length)
Allocate a numeric primitive or character array with the specified type and length.
Definition DataTypes.h:1059
boost::intrusive_ptr< RRNamedBaseMultiDimArray > RRNamedBaseMultiDimArrayPtr
Convenience alias for RRNamedBaseMultiDimArray intrusive_ptr.
Definition DataTypes.h:3073
boost::intrusive_ptr< const RRArray< T > > RRArrayConstPtr
Convenience alias for RRArray const intrusive_ptr.
Definition DataTypes.h:3015
boost::intrusive_ptr< RRNamedMultiDimArray< T > > RRNamedMultiDimArrayPtr
Convenience alias for RRNamedMultiDimArray intrusive_ptr.
Definition DataTypes.h:3078
boost::intrusive_ptr< RRBaseArray > AllocateRRArrayByType(DataTypes type, size_t length)
Allocate an RRBaseArray by type code.
boost::intrusive_ptr< const RRMultiDimBaseArray > RRMultiDimBaseArrayConstPtr
Convenience alias for RRMultiDimBaseArray const intrusive_ptr.
Definition DataTypes.h:3035
boost::intrusive_ptr< RRArray< T > > RRArrayPtr
Convenience alias for RRArray intrusive_ptr.
Definition DataTypes.h:3012
boost::intrusive_ptr< RRStructure > RRStructurePtr
Convenience alias for RRStructure intrusive_ptr.
Definition DataTypes.h:3029
bool IsStringUUID(boost::string_ref str)
Test if a string is a UUID.
static boost::intrusive_ptr< RRMultiDimArray< T > > AllocateRRMultiDimArray(const boost::intrusive_ptr< RRArray< uint32_t > > &dims, const boost::intrusive_ptr< RRArray< T > > &array_)
Allocate a multidimensional using existing dimensions and data array.
Definition DataTypes.h:1789
static boost::intrusive_ptr< RRNamedArray< T > > ScalarToRRNamedArray(const T &value)
Convert a scalar namedarray into a namedarray array with one element.
Definition DataTypes.h:2608
bool IsStringName(boost::string_ref str)
Test if a string is a valid Robot Raconteur name.
boost::intrusive_ptr< const RRBaseArray > RRBaseArrayConstPtr
Convenience alias for RRBaseArray const intrusive_ptr.
Definition DataTypes.h:3009
boost::intrusive_ptr< RRBaseArray > RRBaseArrayPtr
Convenience alias for RRBaseArray intrusive_ptr.
Definition DataTypes.h:3007
static boost::intrusive_ptr< RRArray< T > > AttachRRArray(T *data, size_t length, bool owned)
Allocates an array object and attaches to existing numeric primitive or character array pointer.
Definition DataTypes.h:1083
boost::intrusive_ptr< RRMap< K, T > > AllocateRRMap(const U &c)
Allocate RRMap with value.
Definition DataTypes.h:1844
boost::intrusive_ptr< RRMultiDimArray< T > > RRMultiDimArrayPtr
Convenience alias for RRMultiDimArray intrusive_ptr.
Definition DataTypes.h:3038
boost::intrusive_ptr< const RRPodBaseArray > RRPodBaseArrayConstPtr
Convenience alias for RRPodBaseArray const intrusive_ptr.
Definition DataTypes.h:3045
boost::intrusive_ptr< const RRStructure > RRStructureConstPtr
Convenience alias for RRStructure const intrusive_ptr.
Definition DataTypes.h:3031
boost::intrusive_ptr< const RRValue > RRValueConstPtr
Convenience alias for RRValue const intrusive_ptr.
Definition DataTypes.h:3001
boost::intrusive_ptr< const RRMap< K, T > > RRMapConstPtr
Convenience alias for RRMap const intrusive_ptr.
Definition DataTypes.h:3021
boost::intrusive_ptr< const RRNamedMultiDimArray< T > > RRNamedMultiDimArrayConstPtr
Convenience alias for RRNamedMultiDimArray const intrusive_ptr.
Definition DataTypes.h:3081
std::string BuildServicePath(const std::vector< ServicePathSegment > &segments)
Build a Robot Raconteur service path from segments.
bool IsStringScopedName(boost::string_ref str)
Test if a string is a valid Robot Raconteur scoped name.
boost::intrusive_ptr< const RRNamedArray< T > > RRNamedArrayConstPtr
Convenience alias for RRNamedArray const intrusive_ptr.
Definition DataTypes.h:3071
boost::intrusive_ptr< RRList< T > > AllocateEmptyRRList()
Allocate an empty RRList.
Definition DataTypes.h:1802
static boost::container::static_vector< Y, N > RRArrayToStaticVector(const boost::intrusive_ptr< RRArray< U > > &in)
Convert an RRArray to a boost::static_vector.
Definition DataTypes.h:1328
static boost::intrusive_ptr< RRNamedMultiDimArray< T > > AllocateEmptyRRNamedMultiDimArray(const std::vector< uint32_t > &dims)
Allocate an empty multidimensional namedarray array with the specified dimensions.
Definition DataTypes.h:2573
std::string EncodeServicePathIndex(const std::string &index)
Encode a service path index for use in a Robot Raconteur service path.
static std::vector< Y > RRArrayToVector(const boost::intrusive_ptr< RRArray< U > > &in)
Convert an RRArray<U> to a std::vector<Y>.
Definition DataTypes.h:1215
static boost::array< Y, N > RRArrayToArray(const boost::intrusive_ptr< RRArray< U > > &in)
Convert an RRArray to a boost::array.
Definition DataTypes.h:1258
boost::intrusive_ptr< RRNamedBaseArray > RRNamedBaseArrayPtr
Convenience alias for RRNamedBaseArray intrusive_ptr.
Definition DataTypes.h:3063
static boost::intrusive_ptr< RRArray< Y > > StaticVectorToRRArray(boost::container::static_vector< U, N > in)
Convert a boost::container::static_vector to an RRArray.
Definition DataTypes.h:1381
std::string DecodeServicePathIndex(const std::string &index)
Decode a service path index from a Robot Raconteur service path.
static boost::intrusive_ptr< RRMultiDimArray< T > > AllocateEmptyRRMultiDimArray(const std::vector< uint32_t > &dims)
Allocate an empty multidimensional array with the specified dimensions.
Definition DataTypes.h:1758
DataTypes
Type codes for types supported by Robot Raconteur.
Definition RobotRaconteurConstants.h:41
@ DataTypes_single_t
IEEE-754 32-bit floating point number.
Definition RobotRaconteurConstants.h:47
@ DataTypes_uint8_t
8-bit unsigned integer
Definition RobotRaconteurConstants.h:51
@ DataTypes_int16_t
16-bit signed integer
Definition RobotRaconteurConstants.h:53
@ DataTypes_uint32_t
32-bit unsigned integer
Definition RobotRaconteurConstants.h:59
@ DataTypes_uint16_t
16-bit unsigned integer
Definition RobotRaconteurConstants.h:55
@ DataTypes_int8_t
8-bit signed integer
Definition RobotRaconteurConstants.h:49
@ DataTypes_uint64_t
64-bit unsigned integer
Definition RobotRaconteurConstants.h:63
@ DataTypes_double_t
IEEE-754 64-bit floating point number.
Definition RobotRaconteurConstants.h:45
@ DataTypes_int64_t
64-bit signed integer
Definition RobotRaconteurConstants.h:61
@ DataTypes_string_t
UTF-8 string.
Definition RobotRaconteurConstants.h:65
@ DataTypes_int32_t
32-bit signed integer
Definition RobotRaconteurConstants.h:57
@ DataTypes_void_t
void or null type
Definition RobotRaconteurConstants.h:43
@ DataTypes_bool_t
8-bit boolean
Definition RobotRaconteurConstants.h:71
@ DataTypes_cdouble_t
128-bit complex double (real,imag)
Definition RobotRaconteurConstants.h:67
@ DataTypes_csingle_t
64-bit complex float (real,imag)
Definition RobotRaconteurConstants.h:69
Base class for types that can be stored in MessageElement.
Definition DataTypes.h:374
Exception thrown for an unexpected null value.
Definition Error.h:669
Exception thrown when an attempt to access an array or container index is out of range.
Definition Error.h:875
Numeric primitive or character array value type.
Definition DataTypes.h:581
std::ptrdiff_t difference_type
Definition DataTypes.h:617
RRArray< T > & operator=(const RRArray< T2 > &rhs)
assignment with type conversion
Definition DataTypes.h:713
T value_type
Definition DataTypes.h:605
reference operator[](size_type i)
access specified element
Definition DataTypes.h:655
reference back()
access the last element
Definition DataTypes.h:688
RR_OVIRTUAL size_t size() RR_OVERRIDE
Get the number of elements in the array.
Definition DataTypes.h:597
const_reverse_iterator rend() const
returns a reverse iterator to the end
Definition DataTypes.h:650
const_iterator cend() const
returns a const iterator to the end
Definition DataTypes.h:633
bool empty()
checks whether the container is empty
Definition DataTypes.h:694
const T & const_reference
Definition DataTypes.h:613
std::size_t size_type
Definition DataTypes.h:615
void fill(const T &value)
Fill array with value.
Definition DataTypes.h:732
const_reference at(size_type i) const
access specified element with bounds checking
Definition DataTypes.h:675
iterator begin()
returns an iterator to the beginning
Definition DataTypes.h:622
const_reverse_iterator crend() const
returns a reverse iterator to the end
Definition DataTypes.h:652
reverse_iterator rend()
returns a reverse iterator to the end
Definition DataTypes.h:648
iterator end()
returns an iterator to the end
Definition DataTypes.h:629
const_reference operator[](size_type i) const
access specified element
Definition DataTypes.h:662
size_type max_size()
returns the maximum possible number of elements
Definition DataTypes.h:696
reverse_iterator rbegin()
returns a reverse iterator to the beginning
Definition DataTypes.h:641
boost::reverse_iterator< const_iterator > const_reverse_iterator
Definition DataTypes.h:638
boost::reverse_iterator< iterator > reverse_iterator
Definition DataTypes.h:636
const_iterator end() const
returns an iterator to the end
Definition DataTypes.h:631
const_reverse_iterator rbegin() const
returns a reverse iterator to the beginning
Definition DataTypes.h:643
T * data()
direct access to the underlying array
Definition DataTypes.h:701
const_reference back() const
access the last element
Definition DataTypes.h:691
reference front()
access the first element
Definition DataTypes.h:682
const T * const_iterator
Definition DataTypes.h:609
RR_OVIRTUAL void * void_ptr() RR_OVERRIDE
Get a void pointer to the contained array.
Definition DataTypes.h:593
T * iterator
Definition DataTypes.h:607
T & reference
Definition DataTypes.h:611
const_iterator cbegin() const
returns a const iterator to the beginning
Definition DataTypes.h:626
const_reverse_iterator crbegin() const
returns a reverse iterator to the beginning
Definition DataTypes.h:645
const_reference front() const
access the first element
Definition DataTypes.h:685
const_iterator begin() const
returns an iterator to the beginning
Definition DataTypes.h:624
void assign(const T &value)
Assign one value to all elements.
Definition DataTypes.h:726
reference at(size_type i)
access specified element with bounds checking
Definition DataTypes.h:669
const T * data() const
direct access to the underlying array
Definition DataTypes.h:699
RR_OVIRTUAL size_t ElementSize() RR_OVERRIDE
Get the number of bytes per element of the array.
Definition DataTypes.h:599
Base class for numeric and character array value types.
Definition DataTypes.h:528
virtual size_t size()=0
Get the number of elements in the array.
virtual size_t ElementSize()=0
Get the number of bytes per element of the array.
virtual void * void_ptr()=0
Get a void pointer to the contained array.
List container value type.
Definition DataTypes.h:922
const_iterator begin() const
returns an iterator to the beginning
Definition DataTypes.h:963
std::list< boost::intrusive_ptr< T > >::const_iterator const_iterator
Definition DataTypes.h:954
std::list< boost::intrusive_ptr< T > > & GetStorageContainer()
Get the underlying storage container.
Definition DataTypes.h:1026
void pop_back()
removes the last element
Definition DataTypes.h:1007
std::list< boost::intrusive_ptr< T > >::reference reference
Definition DataTypes.h:944
std::list< boost::intrusive_ptr< T > >::iterator iterator
Definition DataTypes.h:952
std::list< boost::intrusive_ptr< T > >::reverse_iterator reverse_iterator
Definition DataTypes.h:956
std::list< boost::intrusive_ptr< T > >::const_pointer const_pointer
Definition DataTypes.h:942
iterator erase(const_iterator first, const_iterator last)
erases element
Definition DataTypes.h:1013
std::list< boost::intrusive_ptr< T > >::const_reverse_iterator const_reverse_iterator
Definition DataTypes.h:958
const_reverse_iterator const crend()
returns a reverse iterator to the end
Definition DataTypes.h:985
reference front()
access the first element
Definition DataTypes.h:993
std::list< boost::intrusive_ptr< T > >::size_type size_type
Definition DataTypes.h:948
void clear()
clears the contents
Definition DataTypes.h:1015
size_type max_size() const
returns the maximum possible number of elements
Definition DataTypes.h:991
const_reverse_iterator crend() const
returns a reverse iterator to the end
Definition DataTypes.h:975
iterator insert(const_iterator p, const boost::intrusive_ptr< T > &x)
inserts element
Definition DataTypes.h:1009
std::list< boost::intrusive_ptr< T > >::pointer pointer
Definition DataTypes.h:940
const_reference back() const
access the last element
Definition DataTypes.h:999
std::list< boost::intrusive_ptr< T > >::difference_type difference_type
Definition DataTypes.h:950
const_reference front() const
access the first element
Definition DataTypes.h:995
void push_front(const boost::intrusive_ptr< T > &x)
inserts an element at the beginning
Definition DataTypes.h:1001
reference back()
access the last element
Definition DataTypes.h:997
void remove(const boost::intrusive_ptr< T > &value)
removes elements equal to value
Definition DataTypes.h:1017
reverse_iterator rbegin()
returns a reverse iterator to the beginning
Definition DataTypes.h:969
void push_back(const boost::intrusive_ptr< T > &x)
adds an element to the end
Definition DataTypes.h:1003
const_iterator cend() const
returns an iterator to the end
Definition DataTypes.h:981
const_reverse_iterator const crbegin()
returns a reverse iterator to the beginning
Definition DataTypes.h:983
iterator begin()
returns an iterator to the beginning
Definition DataTypes.h:961
const_reverse_iterator rend() const
returns a reverse iterator to the end
Definition DataTypes.h:977
bool empty() const
checks whether the container is empty
Definition DataTypes.h:987
boost::intrusive_ptr< T > value_type
Definition DataTypes.h:938
void pop_front()
removes the first element
Definition DataTypes.h:1005
virtual size_type size() const
returns the number of elements
Definition DataTypes.h:989
const_iterator end() const
returns an iterator to the end
Definition DataTypes.h:967
const_reverse_iterator rbegin() const
returns a reverse iterator to the beginning
Definition DataTypes.h:971
std::list< boost::intrusive_ptr< T > >::const_reference const_reference
Definition DataTypes.h:946
const_iterator cbegin() const
returns an iterator to the beginning
Definition DataTypes.h:979
reverse_iterator rend()
returns a reverse iterator to the end
Definition DataTypes.h:973
iterator erase(const_iterator p)
erases element
Definition DataTypes.h:1011
iterator end()
returns an iterator to the end
Definition DataTypes.h:965
Map container value type.
Definition DataTypes.h:796
void erase(iterator p)
erases element
Definition DataTypes.h:887
std::pair< iterator, bool > insert(const value_type &x)
inserts elements
Definition DataTypes.h:873
iterator end()
returns an iterator to the end
Definition DataTypes.h:843
std::map< K, boost::intrusive_ptr< T > >::value_type value_type
Definition DataTypes.h:816
std::map< K, boost::intrusive_ptr< T > >::key_type key_type
Definition DataTypes.h:812
const_reverse_iterator rbegin() const
returns a reverse iterator to the beginning
Definition DataTypes.h:853
const_iterator begin() const
returns an iterator to the beginning
Definition DataTypes.h:841
const_reverse_iterator crbegin() const
returns a reverse iterator to the beginning
Definition DataTypes.h:851
mapped_type & operator[](const key_type &k)
access or insert the specified element
Definition DataTypes.h:867
std::map< K, boost::intrusive_ptr< T > > & GetStorageContainer()
Get the underlying storage container.
Definition DataTypes.h:908
std::map< K, boost::intrusive_ptr< T > >::const_iterator const_iterator
Definition DataTypes.h:830
const_reverse_iterator crend() const
returns a reverse iterator to the end
Definition DataTypes.h:857
size_type size() const
returns the number of elements
Definition DataTypes.h:863
const_iterator find(const key_type &x) const
finds element with the specified key
Definition DataTypes.h:897
bool empty() const
checks whether the container is empty
Definition DataTypes.h:861
iterator find(const key_type &x)
finds element with the specified key
Definition DataTypes.h:895
void erase(iterator first, iterator last)
erases element
Definition DataTypes.h:891
std::map< K, boost::intrusive_ptr< T > >::const_reverse_iterator const_reverse_iterator
Definition DataTypes.h:834
const mapped_type & at(const key_type &k) const
access specified element with bounds checking
Definition DataTypes.h:871
std::map< K, boost::intrusive_ptr< T > >::pointer pointer
Definition DataTypes.h:818
size_type count(const key_type &x) const
returns the number of elemnts matching the specified key
Definition DataTypes.h:899
reverse_iterator rend()
returns a reverse iterator to the end
Definition DataTypes.h:855
std::map< K, boost::intrusive_ptr< T > >::iterator iterator
Definition DataTypes.h:828
mapped_type & at(const key_type &k)
access specified element with bounds checking
Definition DataTypes.h:869
const_iterator end() const
returns an iterator to the end
Definition DataTypes.h:847
void clear()
clears the contents
Definition DataTypes.h:893
std::map< K, boost::intrusive_ptr< T > >::reverse_iterator reverse_iterator
Definition DataTypes.h:832
std::map< K, boost::intrusive_ptr< T > >::mapped_type mapped_type
Definition DataTypes.h:814
std::map< K, boost::intrusive_ptr< T > >::reference reference
Definition DataTypes.h:822
const_iterator cend() const
returns an iterator to the end
Definition DataTypes.h:845
size_type max_size() const
returns the maximum possible number of elements
Definition DataTypes.h:865
std::map< K, boost::intrusive_ptr< T > >::const_reference const_reference
Definition DataTypes.h:824
iterator begin()
returns an iterator to the beginning
Definition DataTypes.h:837
iterator insert(const_iterator p, const value_type &x)
inserts elements
Definition DataTypes.h:875
const_reverse_iterator rend() const
returns a reverse iterator to the end
Definition DataTypes.h:859
const_iterator cbegin() const
returns an iterator to the beginning
Definition DataTypes.h:839
std::map< K, boost::intrusive_ptr< T > >::const_pointer const_pointer
Definition DataTypes.h:820
std::map< K, boost::intrusive_ptr< T > >::size_type size_type
Definition DataTypes.h:826
size_type erase(const key_type &x)
erases element
Definition DataTypes.h:889
void insert(InputIterator first, InputIterator last)
inserts elements
Definition DataTypes.h:882
reverse_iterator rbegin()
returns a reverse iterator to the beginning
Definition DataTypes.h:849
Numeric primitive multidimensional array value type.
Definition DataTypes.h:1602
virtual void AssignSubArray(const std::vector< uint32_t > &memorypos, const boost::intrusive_ptr< RRMultiDimArray< T > > &buffer, const std::vector< uint32_t > &bufferpos, const std::vector< uint32_t > &count)
Assign a subset of an array.
Definition DataTypes.h:1658
virtual void RetrieveSubArray(const std::vector< uint32_t > &memorypos, const boost::intrusive_ptr< RRMultiDimArray< T > > &buffer, const std::vector< uint32_t > &bufferpos, const std::vector< uint32_t > &count)
Retrieve a subset of an array.
Definition DataTypes.h:1630
Base class for numeric multidimensional arrays.
Definition DataTypes.h:1555
namedarray array value type
Definition DataTypes.h:2271
iterator end()
returns an iterator to the end
Definition DataTypes.h:2345
T & reference
Definition DataTypes.h:2327
const_iterator end() const
returns an iterator to the end
Definition DataTypes.h:2347
const_reverse_iterator crend() const
returns a reverse iterator to the end
Definition DataTypes.h:2368
reverse_iterator rbegin()
returns a reverse iterator to the beginning
Definition DataTypes.h:2357
virtual size_t size() const
returns the number of elements (namedarray elements)
Definition DataTypes.h:2297
RR_OVIRTUAL boost::intrusive_ptr< RRBaseArray > GetNumericBaseArray() RR_OVERRIDE
get the underlying numeric array as an RRBaseArray
Definition DataTypes.h:2311
const_reference front() const
access the first element
Definition DataTypes.h:2400
bool empty()
checks whether the container is empty
Definition DataTypes.h:2408
virtual size_t size()
returns the number of elements (namedarray elements)
Definition DataTypes.h:2299
const_reference at(size_type i) const
access specified namedarray element with bounds checking
Definition DataTypes.h:2391
const_iterator cbegin() const
returns an iterator to the beginning
Definition DataTypes.h:2342
reference back()
access the last element
Definition DataTypes.h:2403
std::size_t size_type
Definition DataTypes.h:2331
const T & const_reference
Definition DataTypes.h:2329
RR_OVIRTUAL DataTypes ElementArrayType() RR_OVERRIDE
get the type of the underlying numeric array
Definition DataTypes.h:2305
const_reference operator[](size_type i) const
access specified namedarray element
Definition DataTypes.h:2378
iterator begin()
returns an iterator to the beginning
Definition DataTypes.h:2338
std::ptrdiff_t difference_type
Definition DataTypes.h:2333
reference front()
access the first element
Definition DataTypes.h:2398
RR_OVIRTUAL size_t ElementSize() RR_OVERRIDE
get the number of bytes per namedarray element of the array
Definition DataTypes.h:2303
const_reverse_iterator rbegin() const
returns a reverse iterator to the beginning
Definition DataTypes.h:2359
const_iterator begin() const
returns an iterator to the beginning
Definition DataTypes.h:2340
RR_OVIRTUAL size_t ElementArrayCount() RR_OVERRIDE
get the total number of elements in the underlying numeric array
Definition DataTypes.h:2307
RRNamedArray(const boost::intrusive_ptr< RRArray< typename RRPrimUtil< T >::ElementArrayType > > &rr_array)
Construct a RRNamedArray object.
Definition DataTypes.h:2288
const_reverse_iterator crbegin() const
returns a reverse iterator to the beginning
Definition DataTypes.h:2361
const_reference back() const
access the last element
Definition DataTypes.h:2405
virtual boost::intrusive_ptr< RRArray< typename RRPrimUtil< T >::ElementArrayType > > GetNumericArray()
get the underlying numeric RRArray
Definition DataTypes.h:2309
reverse_iterator rend()
returns a reverse iterator to the end
Definition DataTypes.h:2364
size_type max_size()
returns the maximum possible number of elements
Definition DataTypes.h:2410
reference operator[](size_type i)
access specified namedarray element
Definition DataTypes.h:2371
const_reverse_iterator rend() const
returns a reverse iterator to the end
Definition DataTypes.h:2366
T * iterator
Definition DataTypes.h:2323
T value_type
Definition DataTypes.h:2321
boost::reverse_iterator< const_iterator > const_reverse_iterator
Definition DataTypes.h:2354
const_iterator cend() const
returns an iterator to the end
Definition DataTypes.h:2349
const T * const_iterator
Definition DataTypes.h:2325
reference at(size_type i)
access specified namedarray element with bounds checking
Definition DataTypes.h:2385
boost::reverse_iterator< iterator > reverse_iterator
Definition DataTypes.h:2352
virtual void * void_ptr()
get a void pointer to the underlying numeric array
Definition DataTypes.h:2301
Base class for namedarray array value types.
Definition DataTypes.h:2242
Base class for namedarray multidimensional arrays.
Definition DataTypes.h:2430
namedarray multidimensional array value type
Definition DataTypes.h:2457
virtual void AssignSubArray(const std::vector< uint32_t > &memorypos, const boost::intrusive_ptr< RRNamedMultiDimArray< T > > &buffer, const std::vector< uint32_t > &bufferpos, const std::vector< uint32_t > &count)
Assign a subset of an array.
Definition DataTypes.h:2514
virtual void RetrieveSubArray(const std::vector< uint32_t > &memorypos, const boost::intrusive_ptr< RRNamedMultiDimArray< T > > &buffer, const std::vector< uint32_t > &bufferpos, const std::vector< uint32_t > &count)
Retrieve a subset of an array.
Definition DataTypes.h:2483
virtual std::string RRType()=0
Gets the type of the object as a string. This string is in C++ format, using two colons to separate n...
pod array value type
Definition DataTypes.h:1889
std::vector< T >::iterator iterator
Definition DataTypes.h:1921
size_type max_size() const
returns the maximum possible number of elements
Definition DataTypes.h:1958
reference front()
access the first element
Definition DataTypes.h:1960
const_reverse_iterator rbegin() const
returns a reverse iterator to the beginning
Definition DataTypes.h:1940
T * data()
direct access to the underlying array
Definition DataTypes.h:1976
const_reference at(size_type i) const
access the specified element with bounds checking
Definition DataTypes.h:1974
std::vector< T >::const_reverse_iterator const_reverse_iterator
Definition DataTypes.h:1927
std::vector< T >::const_reference const_reference
Definition DataTypes.h:1917
reference operator[](size_type i)
access the specified element
Definition DataTypes.h:1968
const_iterator cend() const
returns an iterator to the end
Definition DataTypes.h:1948
const_reference operator[](size_type i) const
access the specified element
Definition DataTypes.h:1970
const_reverse_iterator const crend()
returns a reverse iterator to the end
Definition DataTypes.h:1952
const_reverse_iterator const crbegin()
returns a reverse iterator to the beginning
Definition DataTypes.h:1950
T value_type
Definition DataTypes.h:1909
iterator begin()
returns an iterator to the beginning
Definition DataTypes.h:1930
const_reference back() const
access the last element
Definition DataTypes.h:1966
std::vector< T > & GetStorageContainer()
Get the underlying storage container.
Definition DataTypes.h:1987
reverse_iterator rend()
returns a reverse iterator to the end
Definition DataTypes.h:1942
const_iterator cbegin() const
returns an iterator to the beginning
Definition DataTypes.h:1946
const_iterator end() const
returns an iterator to the end
Definition DataTypes.h:1936
std::vector< T >::reference reference
Definition DataTypes.h:1915
reference back()
access the last element
Definition DataTypes.h:1964
std::vector< T >::const_iterator const_iterator
Definition DataTypes.h:1923
const T * data() const
direct access to the underlying array
Definition DataTypes.h:1978
const_reference front() const
access the first element
Definition DataTypes.h:1962
std::vector< T >::size_type size_type
Definition DataTypes.h:1919
virtual size_type size() const
returns the number of elements
Definition DataTypes.h:1956
iterator end()
returns an iterator to the end
Definition DataTypes.h:1934
reference at(size_type i)
access the specified element with bounds checking
Definition DataTypes.h:1972
const_iterator begin() const
retuns an iterator to the beginning
Definition DataTypes.h:1932
reverse_iterator rbegin()
returns a reverse iterator to the beginning
Definition DataTypes.h:1938
bool empty() const
checks whether the container is empty
Definition DataTypes.h:1954
std::vector< T >::pointer pointer
Definition DataTypes.h:1911
std::vector< T >::reverse_iterator reverse_iterator
Definition DataTypes.h:1925
const_reverse_iterator rend() const
returns a reverse iterator to the end
Definition DataTypes.h:1944
std::vector< T >::const_pointer const_pointer
Definition DataTypes.h:1913
Base class for pod array value types.
Definition DataTypes.h:1868
Base class for pod multidimensional arrays.
Definition DataTypes.h:2015
Base class for user defined pod value types.
Definition DataTypes.h:1857
pod multidimensional array value type
Definition DataTypes.h:2042
virtual void AssignSubArray(const std::vector< uint32_t > &memorypos, const boost::intrusive_ptr< RRPodMultiDimArray< T > > &buffer, const std::vector< uint32_t > &bufferpos, const std::vector< uint32_t > &count)
Assign a subset of an array.
Definition DataTypes.h:2099
virtual void RetrieveSubArray(const std::vector< uint32_t > &memorypos, const boost::intrusive_ptr< RRPodMultiDimArray< T > > &buffer, const std::vector< uint32_t > &bufferpos, const std::vector< uint32_t > &count)
Retrieve a subset of an array.
Definition DataTypes.h:2068
Base class for user defined structure value types.
Definition DataTypes.h:1038
Represents. a point in time. Used by wire members to timestamp packets.
Definition DataTypes.h:2668
bool operator==(const TimeSpec &t2) const
equality comparison
int64_t seconds
Seconds since epoch.
Definition DataTypes.h:2671
bool operator<=(const TimeSpec &t2) const
less-than-or-equal comparison
TimeSpec operator-(const TimeSpec &t2) const
subtraction operator
void cleanup_nanosecs()
normalize nanoseconds to be within 0 and 1e9-1
bool operator>=(const TimeSpec &t2) const
greater-than-or-equal comparison
TimeSpec(int64_t seconds, int32_t nanoseconds)
Construct timespec with specified time.
bool operator!=(const TimeSpec &t2) const
inequality comparison
bool operator<(const TimeSpec &t2) const
less-then comparison
TimeSpec operator+(const TimeSpec &t2) const
addition operator
bool operator>(const TimeSpec &t2) const
greater-than comparison
int32_t nanoseconds
Nanoseconds from epoch. Normalized to be between 0 and 1e9-1.
Definition DataTypes.h:2673
TimeSpec()
Construct empty timespec.
Complex double precision floating point number.
Definition DataTypes.h:77
double real
real component
Definition DataTypes.h:79
cdouble(double r, double i)
Construct a new cdouble.
Definition DataTypes.h:90
cdouble()
Construct a new cdouble with 0.0 real and imag.
Definition DataTypes.h:83
double imag
imaginary component
Definition DataTypes.h:81
Complex single precision floating point number.
Definition DataTypes.h:99
cfloat()
Construct a new csingle with 0.0 real and imag.
Definition DataTypes.h:105
float real
real component
Definition DataTypes.h:101
float imag
imaginary component
Definition DataTypes.h:103
cfloat(float r, float i)
Construct a new cfloat.
Definition DataTypes.h:112
Logical boolean represented using 8 bits.
Definition DataTypes.h:122
rr_bool()
Construct a new false rr_bool.
Definition DataTypes.h:131
uint8_t value
The value of the boolean.
Definition DataTypes.h:128
rr_bool(uint8_t b)
Construct a new rr_bool object.
Definition DataTypes.h:137