Robot Raconteur Core C++ Library
Loading...
Searching...
No Matches
DataTypes.h File Reference

Go to the source code of this file.

Classes

struct  RobotRaconteur::cdouble
 Complex double precision floating point number. More...
struct  RobotRaconteur::cfloat
 Complex single precision floating point number. More...
struct  RobotRaconteur::rr_bool
 Logical boolean represented using 8 bits. More...
class  RobotRaconteur::RRObject
 Base class for all Robot Raconteur objects. More...
class  RobotRaconteur::RRValue
 Base class for all Robot Raconteur value types (except primitives). More...
class  RobotRaconteur::MessageElementData
 Base class for types that can be stored in MessageElement. More...
class  RobotRaconteur::RRBaseArray
 Base class for numeric and character array value types. More...
class  RobotRaconteur::RRArray< T >
 Numeric primitive or character array value type. More...
class  RobotRaconteur::RRMap< K, T >
 Map container value type. More...
class  RobotRaconteur::RRList< T >
 List container value type. More...
class  RobotRaconteur::RRStructure
 Base class for user defined structure value types. More...
class  RobotRaconteur::RRMultiDimBaseArray
 Base class for numeric multidimensional arrays. More...
class  RobotRaconteur::RRMultiDimArray< T >
 Numeric primitive multidimensional array value type. More...
class  RobotRaconteur::RRPod
 Base class for user defined pod value types. More...
class  RobotRaconteur::RRPodBaseArray
 Base class for pod array value types. More...
class  RobotRaconteur::RRPodArray< T >
 pod array value type More...
class  RobotRaconteur::RRPodBaseMultiDimArray
 Base class for pod multidimensional arrays. More...
class  RobotRaconteur::RRPodMultiDimArray< T >
 pod multidimensional array value type More...
class  RobotRaconteur::RRNamedBaseArray
 Base class for namedarray array value types. More...
class  RobotRaconteur::RRNamedArray< T >
 namedarray array value type More...
class  RobotRaconteur::RRNamedBaseMultiDimArray
 Base class for namedarray multidimensional arrays. More...
class  RobotRaconteur::RRNamedMultiDimArray< T >
 namedarray multidimensional array value type More...
class  RobotRaconteur::TimeSpec
 Represents. a point in time. Used by wire members to timestamp packets. More...

Typedefs

using RobotRaconteur::RRObjectPtr = boost::shared_ptr<RRObject>
 Convenience alias for RRObject shared_ptr.
using RobotRaconteur::RRObjectConstPtr = boost::shared_ptr<const RRObject>
 Convenience alias for RRObject const shared_ptr.
using RobotRaconteur::RRValuePtr = boost::intrusive_ptr<RRValue>
 Convenience alias for RRValue intrusive_ptr.
using RobotRaconteur::RRValueConstPtr = boost::intrusive_ptr<const RRValue>
 Convenience alias for RRValue const intrusive_ptr.
using RobotRaconteur::MessageElementDataPtr = boost::intrusive_ptr<MessageElementData>
 Convenience alias for MessageElementData intrusive_ptr.
using RobotRaconteur::MessageElementDataConstPtr = boost::intrusive_ptr<const MessageElementData>
 Convenience alias for MessageElementData const intrusive_ptr.
using RobotRaconteur::RRBaseArrayPtr = boost::intrusive_ptr<RRBaseArray>
 Convenience alias for RRBaseArray intrusive_ptr.
using RobotRaconteur::RRBaseArrayConstPtr = boost::intrusive_ptr<const RRBaseArray>
 Convenience alias for RRBaseArray const intrusive_ptr.
template<typename T>
using RobotRaconteur::RRArrayPtr = boost::intrusive_ptr<RRArray<T> >
 Convenience alias for RRArray intrusive_ptr.
template<typename T>
using RobotRaconteur::RRArrayConstPtr = boost::intrusive_ptr<const RRArray<T> >
 Convenience alias for RRArray const intrusive_ptr.
template<typename K, typename T>
using RobotRaconteur::RRMapPtr = boost::intrusive_ptr<RRMap<K, T> >
 Convenience alias for RRMap intrusive_ptr.
template<typename K, typename T>
using RobotRaconteur::RRMapConstPtr = boost::intrusive_ptr<const RRMap<K, T> >
 Convenience alias for RRMap const intrusive_ptr.
template<typename T>
using RobotRaconteur::RRListPtr = boost::intrusive_ptr<RRList<T> >
 Convenience alias for RRList intrusive_ptr.
template<typename T>
using RobotRaconteur::RRListConstPtr = boost::intrusive_ptr<const RRList<T> >
 Convenience alias for RRList const intrusive_ptr.
using RobotRaconteur::RRStructurePtr = boost::intrusive_ptr<RRStructure>
 Convenience alias for RRStructure intrusive_ptr.
using RobotRaconteur::RRStructureConstPtr = boost::intrusive_ptr<const RRStructure>
 Convenience alias for RRStructure const intrusive_ptr.
using RobotRaconteur::RRMultiDimBaseArrayPtr = boost::intrusive_ptr<RRMultiDimBaseArray>
 Convenience alias for RRMultiDimBaseArray intrusive_ptr.
using RobotRaconteur::RRMultiDimBaseArrayConstPtr = boost::intrusive_ptr<const RRMultiDimBaseArray>
 Convenience alias for RRMultiDimBaseArray const intrusive_ptr.
template<typename T>
using RobotRaconteur::RRMultiDimArrayPtr = boost::intrusive_ptr<RRMultiDimArray<T> >
 Convenience alias for RRMultiDimArray intrusive_ptr.
template<typename T>
using RobotRaconteur::RRMultiDimArrayConstPtr = boost::intrusive_ptr<const RRMultiDimArray<T> >
 Convenience alias for RRMultiDimArray const intrusive_ptr.
using RobotRaconteur::RRPodBaseArrayPtr = boost::intrusive_ptr<RRPodBaseArray>
 Convenience alias for RRPodBaseArray intrusive_ptr.
using RobotRaconteur::RRPodBaseArrayConstPtr = boost::intrusive_ptr<const RRPodBaseArray>
 Convenience alias for RRPodBaseArray const intrusive_ptr.
template<typename T>
using RobotRaconteur::RRPodArrayPtr = boost::intrusive_ptr<RRPodArray<T> >
 Convenience alias for RRPodArray intrusive_ptr.
template<typename T>
using RobotRaconteur::RRPodArrayConstPtr = boost::intrusive_ptr<const RRPodArray<T> >
 Convenience alias for RRPodArray const intrusive_ptr.
using RobotRaconteur::RRPodBaseMultiDimArrayPtr = boost::intrusive_ptr<RRPodBaseMultiDimArray>
 Convenience alias for RRPodBaseMultiDimArray intrusive_ptr.
using RobotRaconteur::RRPodBaseMultiDimBaseArrayConstPtr = boost::intrusive_ptr<const RRPodBaseMultiDimArray>
 Convenience alias for RRPodBaseMultiDimArray const intrusive_ptr.
template<typename T>
using RobotRaconteur::RRPodMultiDimArrayPtr = boost::intrusive_ptr<RRPodMultiDimArray<T> >
 Convenience alias for RRPodMultiDimArray intrusive_ptr.
template<typename T>
using RobotRaconteur::RRPodMultiDimArrayConstPtr = boost::intrusive_ptr<const RRPodMultiDimArray<T> >
 Convenience alias for RRPodMultiDimArray const intrusive_ptr.
using RobotRaconteur::RRNamedBaseArrayPtr = boost::intrusive_ptr<RRNamedBaseArray>
 Convenience alias for RRNamedBaseArray intrusive_ptr.
using RobotRaconteur::RRNamedBaseArrayConstPtr = boost::intrusive_ptr<const RRNamedBaseArray>
 Convenience alias for RRNamedBaseArray const intrusive_ptr.
template<typename T>
using RobotRaconteur::RRNamedArrayPtr = boost::intrusive_ptr<RRNamedArray<T> >
 Convenience alias for RRNamedArray intrusive_ptr.
template<typename T>
using RobotRaconteur::RRNamedArrayConstPtr = boost::intrusive_ptr<const RRNamedArray<T> >
 Convenience alias for RRNamedArray const intrusive_ptr.
using RobotRaconteur::RRNamedBaseMultiDimArrayPtr = boost::intrusive_ptr<RRNamedBaseMultiDimArray>
 Convenience alias for RRNamedBaseMultiDimArray intrusive_ptr.
using RobotRaconteur::RRNamedBaseMultiDimBaseArrayConstPtr = boost::intrusive_ptr<const RRNamedBaseMultiDimArray>
 Convenience alias for RRNamedBaseMultiDimArray const intrusive_ptr.
template<typename T>
using RobotRaconteur::RRNamedMultiDimArrayPtr = boost::intrusive_ptr<RRNamedMultiDimArray<T> >
 Convenience alias for RRNamedMultiDimArray intrusive_ptr.
template<typename T>
using RobotRaconteur::RRNamedMultiDimArrayConstPtr = boost::intrusive_ptr<const RRNamedMultiDimArray<T> >
 Convenience alias for RRNamedMultiDimArray const intrusive_ptr.

Functions

template<typename T, typename U>
static boost::shared_ptr< T > RobotRaconteur::rr_cast (const boost::shared_ptr< U > &objin)
 Dynamic cast a RR_SHARED_PTR type. Throws DataTypeMismatchException if cast is invalid instead of returning null.
template<typename T, typename U>
static boost::intrusive_ptr< T > RobotRaconteur::rr_cast (const boost::intrusive_ptr< U > &objin)
 Dynamic cast a RR_INTRUSIVE_PTR type. This is used to cast value types stored using intrusive pointers. Throws DataTypeMismatchException if cast is invalid instead of returning null.
template<typename T>
static boost::intrusive_ptr< RRArray< T > > RobotRaconteur::ScalarToRRArray (T value)
 Convert a scalar number into an array with one element.
template<typename T>
static T RobotRaconteur::RRArrayToScalar (const boost::intrusive_ptr< RRArray< T > > &value)
 Convert an array with one element into a scalar.
boost::intrusive_ptr< RRArray< char > > RobotRaconteur::stringToRRArray (boost::string_ref str)
 Convert a string to an array of characters.
std::string RobotRaconteur::RRArrayToString (const boost::intrusive_ptr< RRArray< char > > &arr)
 Convert an array of characters into std::string.
template<typename T>
static boost::intrusive_ptr< RRArray< T > > RobotRaconteur::AllocateRRArray (size_t length)
 Allocate a numeric primitive or character array with the specified type and length.
template<typename T>
static boost::intrusive_ptr< RRArray< T > > RobotRaconteur::AttachRRArray (T *data, size_t length, bool owned)
 Allocates an array object and attaches to existing numeric primitive or character array pointer.
template<typename T>
static boost::intrusive_ptr< RRArray< T > > RobotRaconteur::AttachRRArrayCopy (const T *data, const size_t length)
 Allocates an array object and copies existing numeric.
boost::intrusive_ptr< RRBaseArrayRobotRaconteur::AllocateRRArrayByType (DataTypes type, size_t length)
 Allocate an RRBaseArray by type code.
template<typename T>
static boost::intrusive_ptr< RRArray< T > > RobotRaconteur::AllocateEmptyRRArray (size_t length)
 Allocate a numeric primitive or character array with the specified type and length and initialize to zero.
size_t RobotRaconteur::RRArrayElementSize (DataTypes type)
 Get the number of bytes to store a numeric primitive scalar.
template<typename Y, typename U>
static std::vector< Y > RobotRaconteur::RRArrayToVector (const boost::intrusive_ptr< RRArray< U > > &in)
 Convert an RRArray<U> to a std::vector<Y>.
template<typename Y, typename U>
static boost::intrusive_ptr< RRArray< Y > > RobotRaconteur::VectorToRRArray (const std::vector< U > &in)
 Convert a std::vector to an RRArray<Y>.
template<typename Y, std::size_t N, typename U>
static boost::array< Y, N > RobotRaconteur::RRArrayToArray (const boost::intrusive_ptr< RRArray< U > > &in)
 Convert an RRArray to a boost::array.
template<typename Y, std::size_t N, typename U>
static void RobotRaconteur::RRArrayToArray (boost::array< Y, N > &out, const boost::intrusive_ptr< RRArray< U > > &in)
 Convert an RRArray to a boost::array.
template<typename Y, typename U, std::size_t N>
static boost::intrusive_ptr< RRArray< Y > > RobotRaconteur::ArrayToRRArray (boost::array< U, N > in)
 Convert a boost::array to an RRArray.
template<typename Y, std::size_t N, typename U>
static boost::container::static_vector< Y, N > RobotRaconteur::RRArrayToStaticVector (const boost::intrusive_ptr< RRArray< U > > &in)
 Convert an RRArray to a boost::static_vector.
template<typename Y, std::size_t N, typename U>
static void RobotRaconteur::RRArrayToStaticVector (boost::container::static_vector< Y, N > &out, const boost::intrusive_ptr< RRArray< U > > &in)
 Convert an RRArray to a boost::static_vector.
template<typename Y, typename U, std::size_t N>
static boost::intrusive_ptr< RRArray< Y > > RobotRaconteur::StaticVectorToRRArray (boost::container::static_vector< U, N > in)
 Convert a boost::container::static_vector to an RRArray.
boost::intrusive_ptr< RRList< RRArray< char > > > RobotRaconteur::stringVectorToRRList (const std::vector< std::string > &string_vector)
 Convert a string vector to a RRList.
std::vector< std::string > RobotRaconteur::RRListToStringVector (const boost::intrusive_ptr< RRList< RRArray< char > > > &list)
 Convert a RRList containing strings to a string vector.
template<typename T>
boost::intrusive_ptr< T > & RobotRaconteur::rr_null_check (boost::intrusive_ptr< T > &ptr)
 Checks if a value RR_INTRUSIVE_PTR is null.
template<typename T>
boost::intrusive_ptr< T > & RobotRaconteur::rr_null_check (boost::intrusive_ptr< T > &ptr, const char *msg)
 Checks if a value RR_INTRUSIVE_PTR is null with exception message.
template<typename T>
const boost::intrusive_ptr< T > & RobotRaconteur::rr_null_check (const boost::intrusive_ptr< T > &ptr)
 Checks if a value const RR_INTRUSIVE_PTR is null.
template<typename T>
const boost::intrusive_ptr< T > & RobotRaconteur::rr_null_check (const boost::intrusive_ptr< T > &ptr, const char *msg)
 Checks if a value const RR_INTRUSIVE_PTR is null with exception message.
template<typename T>
static boost::intrusive_ptr< RRMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRMultiDimArray (const std::vector< uint32_t > &dims)
 Allocate an empty multidimensional array with the specified dimensions.
template<typename T>
static boost::intrusive_ptr< RRMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRMultiDimArray ()
 Allocate an empty multidimensional array.
template<typename T>
static boost::intrusive_ptr< RRMultiDimArray< T > > RobotRaconteur::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.
template<typename T>
boost::intrusive_ptr< RRList< T > > RobotRaconteur::AllocateEmptyRRList ()
 Allocate an empty RRList.
template<typename T, typename U>
boost::intrusive_ptr< RRList< T > > RobotRaconteur::AllocateRRList (const U &c)
 Allocate RRList with a value.
template<typename K, typename T>
boost::intrusive_ptr< RRMap< K, T > > RobotRaconteur::AllocateEmptyRRMap ()
 Allocate an empty RRMap.
template<typename K, typename T, typename U>
boost::intrusive_ptr< RRMap< K, T > > RobotRaconteur::AllocateRRMap (const U &c)
 Allocate RRMap with value.
template<typename T>
static boost::intrusive_ptr< RRPodArray< T > > RobotRaconteur::ScalarToRRPodArray (const T &value)
 Convert a scalar pod into a pod array with one element.
template<typename T>
static T RobotRaconteur::RRPodArrayToScalar (const boost::intrusive_ptr< RRPodArray< T > > &value)
 Convert a pod array with one element into a scalar pod.
template<typename T>
static boost::intrusive_ptr< RRPodArray< T > > RobotRaconteur::AllocateEmptyRRPodArray (size_t length)
 Allocate a pod array with the specified type and length and initialize to zero.
template<typename T>
static boost::intrusive_ptr< RRPodMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRPodMultiDimArray (const std::vector< uint32_t > &dims)
 Allocate an empty multidimensional pod array with the specified dimensions.
template<typename T>
static boost::intrusive_ptr< RRPodMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRPodMultiDimArray ()
 Allocate an empty multidimensional pod array with zero elements.
template<typename T>
static boost::intrusive_ptr< RRNamedArray< T > > RobotRaconteur::AllocateEmptyRRNamedArray (size_t length)
 Allocate a namedarray array with the specified type and length and initialize to zero.
template<typename T>
static boost::intrusive_ptr< RRNamedMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRNamedMultiDimArray (const std::vector< uint32_t > &dims)
 Allocate an empty multidimensional namedarray array with the specified dimensions.
template<typename T>
static boost::intrusive_ptr< RRNamedMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRNamedMultiDimArray ()
 Allocate an empty multidimensional namedarray array with zero elements.
template<typename T>
static boost::intrusive_ptr< RRNamedArray< T > > RobotRaconteur::ScalarToRRNamedArray (const T &value)
 Convert a scalar namedarray into a namedarray array with one element.
template<typename T>
static T RobotRaconteur::RRNamedArrayToScalar (const boost::intrusive_ptr< RRNamedArray< T > > &value)
 Convert a namedarray array with one element into a namedarray.
boost::posix_time::ptime RobotRaconteur::TimeSpecToPTime (const TimeSpec &ts)
 Convert a TimeSpec into a boost::posix_time::ptime.
TimeSpec RobotRaconteur::ptimeToTimeSpec (const boost::posix_time::ptime &t)
 Convert a boost::posix_time::ptime into a TimeSpec.
std::string RobotRaconteur::EncodeServicePathIndex (const std::string &index)
 Encode a service path index for use in a Robot Raconteur service path.
std::string RobotRaconteur::DecodeServicePathIndex (const std::string &index)
 Decode a service path index from a Robot Raconteur service path.
std::vector< ServicePathSegment > RobotRaconteur::ParseServicePath (const std::string &path)
 Parse a Robot Raconteur service path into segments.
std::string RobotRaconteur::BuildServicePath (const std::vector< ServicePathSegment > &segments)
 Build a Robot Raconteur service path from segments.
bool RobotRaconteur::IsStringName (boost::string_ref str)
 Test if a string is a valid Robot Raconteur name.
bool RobotRaconteur::IsStringScopedName (boost::string_ref str)
 Test if a string is a valid Robot Raconteur scoped name.
bool RobotRaconteur::IsStringUUID (boost::string_ref str)
 Test if a string is a UUID.
bool RobotRaconteur::IsStringIdentifier (boost::string_ref str)
 Test if a string is a Robot Raconteur identifier.

Detailed Description

Author
John Wason, PhD
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ AllocateEmptyRRArray()

template<typename T>
boost::intrusive_ptr< RRArray< T > > RobotRaconteur::AllocateEmptyRRArray ( size_t length)
static

Allocate a numeric primitive or character array with the specified type and length and initialize to zero.

All elements are initialized to zero

Valid values for T are rr_bool, double, float, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, cdouble, csingle, or char. Attempts to use any other types will result in a compiler error.

Template Parameters
TThe type of the array elements
Parameters
lengthThe length of the returned array (element count)
Returns
RR_INTRUSIVE_PTR<RRArray<T> > The allocated array

◆ AllocateEmptyRRList()

template<typename T>
boost::intrusive_ptr< RRList< T > > RobotRaconteur::AllocateEmptyRRList ( )

Allocate an empty RRList.

Template Parameters
TThe type of value stored in the list
Returns
RR_INTRUSIVE_PTR<RRList<T> > The allocated empty list

◆ AllocateEmptyRRMap()

template<typename K, typename T>
boost::intrusive_ptr< RRMap< K, T > > RobotRaconteur::AllocateEmptyRRMap ( )

Allocate an empty RRMap.

Template Parameters
KThe key type for map. Must be int32_t or std::string
TThe type of value stored in map
Returns
RR_INTRUSIVE_PTR<RRMap<K,T> > The allocated map

◆ AllocateEmptyRRMultiDimArray() [1/2]

template<typename T>
boost::intrusive_ptr< RRMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRMultiDimArray ( )
static

Allocate an empty multidimensional array.

Template Parameters
TThe element type of the array
Returns
RR_INTRUSIVE_PTR<RRMultiDimArray<T> > The allocated empty multidimensional array

◆ AllocateEmptyRRMultiDimArray() [2/2]

template<typename T>
boost::intrusive_ptr< RRMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRMultiDimArray ( const std::vector< uint32_t > & dims)
static

Allocate an empty multidimensional array with the specified dimensions.

The elements of the returned array are initialized to zero

Template Parameters
TThe element type of the array
Parameters
dimsThe dimensions of the new multidimensional array
Returns
RR_INTRUSIVE_PTR<RRMultiDimArray<T> > The allocated multidimensional array

◆ AllocateEmptyRRNamedArray()

template<typename T>
boost::intrusive_ptr< RRNamedArray< T > > RobotRaconteur::AllocateEmptyRRNamedArray ( size_t length)
static

Allocate a namedarray array with the specified type and length and initialize to zero.

All elements are initialized to zero

T must be a namedarray type that has been generated as part of the thunk source.

Template Parameters
TThe type of the array elements
Parameters
lengthThe length of the returned array (element count)
Returns
RR_INTRUSIVE_PTR<RRNamedArray<T> > The allocated array

◆ AllocateEmptyRRNamedMultiDimArray() [1/2]

template<typename T>
boost::intrusive_ptr< RRNamedMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRNamedMultiDimArray ( )
static

Allocate an empty multidimensional namedarray array with zero elements.

T must be a namedarray type that has been generated as part of the thunk source.

Template Parameters
TThe element type of the array
Returns
RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> > The allocated multidimensional array

◆ AllocateEmptyRRNamedMultiDimArray() [2/2]

template<typename T>
boost::intrusive_ptr< RRNamedMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRNamedMultiDimArray ( const std::vector< uint32_t > & dims)
static

Allocate an empty multidimensional namedarray array with the specified dimensions.

The elements of the returned array are initialized to zero

T must be a namedarray type that has been generated as part of the thunk source.

Template Parameters
TThe element type of the array
Parameters
dimsThe dimensions of the new multidimensional array
Returns
RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> > The allocated multidimensional array

◆ AllocateEmptyRRPodArray()

template<typename T>
boost::intrusive_ptr< RRPodArray< T > > RobotRaconteur::AllocateEmptyRRPodArray ( size_t length)
static

Allocate a pod array with the specified type and length and initialize to zero.

All elements are initialized to zero

T must be a pod type that has been generated as part of the thunk source.

Template Parameters
TThe type of the array elements
Parameters
lengthThe length of the returned array (element count)
Returns
RR_INTRUSIVE_PTR<RRPodArray<T> > The allocated array

◆ AllocateEmptyRRPodMultiDimArray() [1/2]

template<typename T>
boost::intrusive_ptr< RRPodMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRPodMultiDimArray ( )
static

Allocate an empty multidimensional pod array with zero elements.

T must be a pod type that has been generated as part of the thunk source.

Template Parameters
TThe element type of the array
Returns
RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> > The allocated multidimensional array

◆ AllocateEmptyRRPodMultiDimArray() [2/2]

template<typename T>
boost::intrusive_ptr< RRPodMultiDimArray< T > > RobotRaconteur::AllocateEmptyRRPodMultiDimArray ( const std::vector< uint32_t > & dims)
static

Allocate an empty multidimensional pod array with the specified dimensions.

The elements of the returned array are initialized to zero

T must be a pod type that has been generated as part of the thunk source.

Template Parameters
TThe element type of the array
Parameters
dimsThe dimensions of the new multidimensional array
Returns
RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> > The allocated multidimensional array

◆ AllocateRRArray()

template<typename T>
boost::intrusive_ptr< RRArray< T > > RobotRaconteur::AllocateRRArray ( size_t length)
static

Allocate a numeric primitive or character array with the specified type and length.

This function does not initialize the returned array. The contents will not be set to zero.

Valid values for T are rr_bool, double, float, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, cdouble, csingle, or char. Attempts to use any other types will result in a compiler error.

Template Parameters
TThe type of the array elements
Parameters
lengthThe length of the returned array (element count)
Returns
RR_INTRUSIVE_PTR<RRArray<T> > The allocated array

◆ AllocateRRArrayByType()

boost::intrusive_ptr< RRBaseArray > RobotRaconteur::AllocateRRArrayByType ( DataTypes type,
size_t length )

Allocate an RRBaseArray by type code.

This function does not initialize the returned array. The contents will not be set to zero.

Valid values for type are DataTypes_bool_t, DataTypes_double_t, DataTypes_single_t, DataTypes_int8_t, DataTypes_uint8_t, DataTypes_int16_t, DataTypes_uint16_t, DataTypes_int32_t, DataTypes_uint32_t, DataTypes_int64_t, DataTypes_uint64_t, DataTypes_cdouble_t, orDataTypes_csingle_t. Attempts to use any other types will result in an InvalidArgumentException.

Parameters
typeThe type code
lengthThe length of the returned array (element count)
Returns
RR_INTRUSIVE_PTR<RRBaseArray> The allocated array

◆ AllocateRRList()

template<typename T, typename U>
boost::intrusive_ptr< RRList< T > > RobotRaconteur::AllocateRRList ( const U & c)

Allocate RRList with a value.

Template Parameters
TThe type of value stored in the list
UThe type of the argument to pass to RRList constructor
Parameters
cExisting list to copy
Returns
RR_INTRUSIVE_PTR<RRList<T> > The allocated list

◆ AllocateRRMap()

template<typename K, typename T, typename U>
boost::intrusive_ptr< RRMap< K, T > > RobotRaconteur::AllocateRRMap ( const U & c)

Allocate RRMap with value.

Template Parameters
KThe key type for map. Must be int32_t or std::string
TThe type of value stored in map
UThe type of the argument to pass to RRMap constructor
Parameters
cExisting map to copy
Returns
RR_INTRUSIVE_PTR<RRMap<K, T> > The allocated map

◆ AllocateRRMultiDimArray()

template<typename T>
boost::intrusive_ptr< RRMultiDimArray< T > > RobotRaconteur::AllocateRRMultiDimArray ( const boost::intrusive_ptr< RRArray< uint32_t > > & dims,
const boost::intrusive_ptr< RRArray< T > > & array_ )
static

Allocate a multidimensional using existing dimensions and data array.

This function does not copy the provided arrays

Template Parameters
TThe element type of the array
Parameters
dimsThe existing
array_The existing flattened array
Returns
RR_INTRUSIVE_PTR<RRMultiDimArray<T> > The allocated multidimensional array

◆ ArrayToRRArray()

template<typename Y, typename U, std::size_t N>
boost::intrusive_ptr< RRArray< Y > > RobotRaconteur::ArrayToRRArray ( boost::array< U, N > in)
static

Convert a boost::array to an RRArray.

boost::numeric_cast<Y>() is used to convert between numeric types

Template Parameters
YThe type of the output RRArray elements
UThe type of the input boost::array elements
NThe number of elements in the input boost::array
Parameters
inThe input boost::array to be converted
Returns
RR_INTRUSIVE_PTR<RRArray<Y> > The output RRArray filled with values converted from in

◆ AttachRRArray()

template<typename T>
boost::intrusive_ptr< RRArray< T > > RobotRaconteur::AttachRRArray ( T * data,
size_t length,
bool owned )
static

Allocates an array object and attaches to existing numeric primitive or character array pointer.

This function will attach to an existing numeric array pointer, and provide read/write access to its contents. If owned is true, the array will be deleted using delete[] when the reference count of the array object goes to zero.

Valid values for T are rr_bool, double, float, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, cdouble, csingle, or char. Attempts to use any other types will result in a compiler error.

Template Parameters
TThe type of the array elements
Parameters
dataPointer to existing numeric primitive or character array
lengthLength of existing array (element count)
ownedtrue if the data lifetime is owned by the new array object
Returns
RR_INTRUSIVE_PTR<RRArray<T> > The allocated array object

◆ AttachRRArrayCopy()

template<typename T>
boost::intrusive_ptr< RRArray< T > > RobotRaconteur::AttachRRArrayCopy ( const T * data,
const size_t length )
static

Allocates an array object and copies existing numeric.

Valid values for T are rr_bool, double, float, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, cdouble, csingle, or char. Attempts to use any other types will result in a compiler error.

Template Parameters
TThe type of the array elements
Parameters
dataPointer to existing numeric
lengthLength of existing array (element count)
Returns
RR_INTRUSIVE_PTR<RRArray<T> > The allocated array object with copied data

◆ BuildServicePath()

std::string RobotRaconteur::BuildServicePath ( const std::vector< ServicePathSegment > & segments)

Build a Robot Raconteur service path from segments.

Parameters
segmentsThe segments to build the service path from
Returns
std::string The built service path

◆ DecodeServicePathIndex()

std::string RobotRaconteur::DecodeServicePathIndex ( const std::string & index)

Decode a service path index from a Robot Raconteur service path.

Parameters
indexThe index to decode
Returns
std::string The decoded index

◆ EncodeServicePathIndex()

std::string RobotRaconteur::EncodeServicePathIndex ( const std::string & index)

Encode a service path index for use in a Robot Raconteur service path.

Parameters
indexThe index to encode
Returns
std::string The encoded index

◆ IsStringIdentifier()

bool RobotRaconteur::IsStringIdentifier ( boost::string_ref str)

Test if a string is a Robot Raconteur identifier.

Parameters
strThe string to test
Returns
true The string is a Robot Raconteur identifier

◆ IsStringName()

bool RobotRaconteur::IsStringName ( boost::string_ref str)

Test if a string is a valid Robot Raconteur name.

Parameters
strThe string to test
Returns
true The string is a valid Robot Raconteur name

◆ IsStringScopedName()

bool RobotRaconteur::IsStringScopedName ( boost::string_ref str)

Test if a string is a valid Robot Raconteur scoped name.

Parameters
strThe string to test
Returns
true The string is a valid Robot Raconteur scoped name

◆ IsStringUUID()

bool RobotRaconteur::IsStringUUID ( boost::string_ref str)

Test if a string is a UUID.

Parameters
strThe string to test
Returns
true The string is a UUID

◆ ParseServicePath()

std::vector< ServicePathSegment > RobotRaconteur::ParseServicePath ( const std::string & path)

Parse a Robot Raconteur service path into segments.

Parameters
pathThe service path to parse
Returns
std::vector<ServicePathSegment> The parsed service path segments

◆ ptimeToTimeSpec()

TimeSpec RobotRaconteur::ptimeToTimeSpec ( const boost::posix_time::ptime & t)

Convert a boost::posix_time::ptime into a TimeSpec.

Parameters
tThe ptime to convert
Returns
TimeSpec The converted TimeSpec

◆ rr_cast() [1/2]

template<typename T, typename U>
boost::intrusive_ptr< T > RobotRaconteur::rr_cast ( const boost::intrusive_ptr< U > & objin)
static

Dynamic cast a RR_INTRUSIVE_PTR type. This is used to cast value types stored using intrusive pointers. Throws DataTypeMismatchException if cast is invalid instead of returning null.

Template Parameters
TOutput cast pointer type
UInput pointer type
Parameters
objinThe object to cast
Returns
RR_INTRUSIVE_PTR<T> The object dynamically cast to RR_INTRUSIVE_PTR of type T

◆ rr_cast() [2/2]

template<typename T, typename U>
boost::shared_ptr< T > RobotRaconteur::rr_cast ( const boost::shared_ptr< U > & objin)
static

Dynamic cast a RR_SHARED_PTR type. Throws DataTypeMismatchException if cast is invalid instead of returning null.

Template Parameters
TOutput cast pointer type
UInput pointer type
Parameters
objinThe object to cast
Returns
RR_SHARED_PTR<T> The object dynamically cast to RR_SHARED_PTR of type T

◆ rr_null_check() [1/4]

template<typename T>
boost::intrusive_ptr< T > & RobotRaconteur::rr_null_check ( boost::intrusive_ptr< T > & ptr)

Checks if a value RR_INTRUSIVE_PTR is null.

If the value is null, throws NullValueException

Returns reference to ptr

Template Parameters
TThe type of the value contained in RR_INTRUSIVE_PTR
Parameters
ptrThe value to check
Returns
RR_INTRUSIVE_PTR<T>& Reference to ptr

◆ rr_null_check() [2/4]

template<typename T>
boost::intrusive_ptr< T > & RobotRaconteur::rr_null_check ( boost::intrusive_ptr< T > & ptr,
const char * msg )

Checks if a value RR_INTRUSIVE_PTR is null with exception message.

If the value is null, throws NullValueException with the message specified in msg

Returns reference to ptr

Template Parameters
TThe type of the value contained in RR_INTRUSIVE_PTR
Parameters
ptrThe value to check
msgError message for NullValueException if ptr is null
Returns
RR_INTRUSIVE_PTR<T>& Reference to ptr

◆ rr_null_check() [3/4]

template<typename T>
const boost::intrusive_ptr< T > & RobotRaconteur::rr_null_check ( const boost::intrusive_ptr< T > & ptr)

Checks if a value const RR_INTRUSIVE_PTR is null.

If the value is null, throws NullValueException

Returns reference to ptr

Template Parameters
TThe type of the value contained in RR_INTRUSIVE_PTR
Parameters
ptrThe value to check
Returns
RR_INTRUSIVE_PTR<T>& Reference to ptr

◆ rr_null_check() [4/4]

template<typename T>
const boost::intrusive_ptr< T > & RobotRaconteur::rr_null_check ( const boost::intrusive_ptr< T > & ptr,
const char * msg )

Checks if a value const RR_INTRUSIVE_PTR is null with exception message.

If the value is null, throws NullValueException with the message specified in msg

Returns reference to ptr

Template Parameters
TThe type of the value contained in RR_INTRUSIVE_PTR
Parameters
ptrThe value to check
msgError message for NullValueException if ptr is null
Returns
RR_INTRUSIVE_PTR<T>& Reference to ptr

◆ RRArrayElementSize()

size_t RobotRaconteur::RRArrayElementSize ( DataTypes type)

Get the number of bytes to store a numeric primitive scalar.

Valid values for type are DataTypes_bool_t, DataTypes_double_t, DataTypes_single_t, DataTypes_int8_t, DataTypes_uint8_t, DataTypes_int16_t, DataTypes_uint16_t, DataTypes_int32_t, DataTypes_uint32_t, DataTypes_int64_t, DataTypes_uint64_t, DataTypes_cdouble_t, orDataTypes_csingle_t. Attempts to use any other types will result in a InvalidArgumentException.

Parameters
typeThe numeric type
Returns
size_t The number of bytes

◆ RRArrayToArray() [1/2]

template<typename Y, std::size_t N, typename U>
void RobotRaconteur::RRArrayToArray ( boost::array< Y, N > & out,
const boost::intrusive_ptr< RRArray< U > > & in )
static

Convert an RRArray to a boost::array.

boost::numeric_cast<Y>() is used to convert between numeric types

Template Parameters
YThe type of the output boost::array elements
NThe number of elements of the boost::array
UThe type of the output boost::array elements to be converted
Parameters
inThe input RRArray to be converted
outThe target boost::array for converted elements

◆ RRArrayToArray() [2/2]

template<typename Y, std::size_t N, typename U>
boost::array< Y, N > RobotRaconteur::RRArrayToArray ( const boost::intrusive_ptr< RRArray< U > > & in)
static

Convert an RRArray to a boost::array.

boost::numeric_cast<Y>() is used to convert between numeric types

Template Parameters
YThe type of the output boost::array elements
NThe number of elements of the boost::array
UThe type of the output boost::array elements to be converted
Parameters
inThe input RRArray to be converted
Returns
boost::array<Y,N> The output boost::array filled with values converted from in

◆ RRArrayToScalar()

template<typename T>
T RobotRaconteur::RRArrayToScalar ( const boost::intrusive_ptr< RRArray< T > > & value)
static

Convert an array with one element into a scalar.

Template Parameters
TThe type of the number
Parameters
valueThe array with one element
Returns
T The scalar value of the first element in the array

◆ RRArrayToStaticVector() [1/2]

template<typename Y, std::size_t N, typename U>
void RobotRaconteur::RRArrayToStaticVector ( boost::container::static_vector< Y, N > & out,
const boost::intrusive_ptr< RRArray< U > > & in )
static

Convert an RRArray to a boost::static_vector.

boost::container::static vector is a vector with fixed maximum capacity N

boost::numeric_cast<Y>() is used to convert between numeric types

Template Parameters
YThe type of the output boost::static_vector elements
NThe maximum element capacity of the output vector
UThe type of the input RRArray elements
Parameters
outThe target boost::container::static_vector for converted elements
inThe input RRArray to be converted

◆ RRArrayToStaticVector() [2/2]

template<typename Y, std::size_t N, typename U>
boost::container::static_vector< Y, N > RobotRaconteur::RRArrayToStaticVector ( const boost::intrusive_ptr< RRArray< U > > & in)
static

Convert an RRArray to a boost::static_vector.

boost::container::static vector is a vector with fixed maximum capacity N

boost::numeric_cast<Y>() is used to convert between numeric types

Template Parameters
YThe type of the output boost::static_vector elements
NThe maximum element capacity of the output vector
UThe type of the input RRArray elements
Parameters
inThe input RRArray to be converted
Returns
boost::container::static_vector<Y, N> The output boost::container::static_vector with values converted from in

◆ RRArrayToString()

std::string RobotRaconteur::RRArrayToString ( const boost::intrusive_ptr< RRArray< char > > & arr)

Convert an array of characters into std::string.

This function creates a new copy of the data stored in the returned std::string.

Parameters
arrThe array of characters
Returns
std::string

◆ RRArrayToVector()

template<typename Y, typename U>
std::vector< Y > RobotRaconteur::RRArrayToVector ( const boost::intrusive_ptr< RRArray< U > > & in)
static

Convert an RRArray<U> to a std::vector<Y>.

This function creates a copy of the data in an alloctade RRArray<T>

boost::numeric_cast<Y>() is used to convert between numeric types

Template Parameters
YThe type of the output std::vector elements
UThe type of the input RRArray elements
Parameters
inThe input RRArray to be converted
Returns
std::vector<Y> The output std::vector filled with the values converted from in

◆ RRListToStringVector()

std::vector< std::string > RobotRaconteur::RRListToStringVector ( const boost::intrusive_ptr< RRList< RRArray< char > > > & list)

Convert a RRList containing strings to a string vector.

This function creates copies of the strings

Parameters
listThe input RRList to be converted
Returns
std::vector<std::string> The converted string vector

◆ RRNamedArrayToScalar()

template<typename T>
T RobotRaconteur::RRNamedArrayToScalar ( const boost::intrusive_ptr< RRNamedArray< T > > & value)
static

Convert a namedarray array with one element into a namedarray.

Note that this acts on the namedarray union, not a scalar number within the namedarray union

Template Parameters
TThe type of the namedarray
Parameters
valueThe namedarray array with one element
Returns
T The first namedarray in the array

◆ RRPodArrayToScalar()

template<typename T>
T RobotRaconteur::RRPodArrayToScalar ( const boost::intrusive_ptr< RRPodArray< T > > & value)
static

Convert a pod array with one element into a scalar pod.

Template Parameters
TThe type of the pod
Parameters
valueThe pod array with one element
Returns
T The first pod in the array

◆ ScalarToRRArray()

template<typename T>
boost::intrusive_ptr< RRArray< T > > RobotRaconteur::ScalarToRRArray ( T value)
static

Convert a scalar number into an array with one element.

Template Parameters
TThe type of the number
Parameters
valueThe value of the number
Returns
RR_INTRUSIVE_PTR<RRArray<T> > The new array with one element

◆ ScalarToRRNamedArray()

template<typename T>
boost::intrusive_ptr< RRNamedArray< T > > RobotRaconteur::ScalarToRRNamedArray ( const T & value)
static

Convert a scalar namedarray into a namedarray array with one element.

Note that this acts on the namedarray union, not a scalar number within the namedarray union

Template Parameters
TThe type of the namedarray
Parameters
valueThe namedarray
Returns
RR_INTRUSIVE_PTR<RRPodArray<T> > The new namedarray array with one element

◆ ScalarToRRPodArray()

template<typename T>
boost::intrusive_ptr< RRPodArray< T > > RobotRaconteur::ScalarToRRPodArray ( const T & value)
static

Convert a scalar pod into a pod array with one element.

Template Parameters
TThe type of the pod
Parameters
valueThe pod
Returns
RR_INTRUSIVE_PTR<RRPodArray<T> > The new pod array with one element

◆ StaticVectorToRRArray()

template<typename Y, typename U, std::size_t N>
boost::intrusive_ptr< RRArray< Y > > RobotRaconteur::StaticVectorToRRArray ( boost::container::static_vector< U, N > in)
static

Convert a boost::container::static_vector to an RRArray.

boost::container::static vector is a vector with fixed maximum capacity N

boost::numeric_cast<Y>() is used to convert between numeric types

Template Parameters
YThe type of the input RRArray elements
UThe type of the output boost::static_vector elements
NThe maximum element capacity of the input vector
Parameters
inThe input boost::container::static_vector to be converted
Returns
RR_INTRUSIVE_PTR<RRArray<Y> > The output RRArray with values converted from in

◆ stringToRRArray()

boost::intrusive_ptr< RRArray< char > > RobotRaconteur::stringToRRArray ( boost::string_ref str)

Convert a string to an array of characters.

This function creates a new copy of the data stored in the returned array

Parameters
strThe string t convert
Returns
RR_INTRUSIVE_PTR<RRArray<char> >

◆ stringVectorToRRList()

boost::intrusive_ptr< RRList< RRArray< char > > > RobotRaconteur::stringVectorToRRList ( const std::vector< std::string > & string_vector)

Convert a string vector to a RRList.

This function creates copies of the strings

Parameters
string_vectorThe input string vector to be converted
Returns
RR_INTRUSIVE_PTR<RRList<RRArray<char> > > The converted RRList

◆ TimeSpecToPTime()

boost::posix_time::ptime RobotRaconteur::TimeSpecToPTime ( const TimeSpec & ts)

Convert a TimeSpec into a boost::posix_time::ptime.

Parameters
tsThe TimeSpec to convert
Returns
boost::posix_time::ptime The converted ptime

◆ VectorToRRArray()

template<typename Y, typename U>
boost::intrusive_ptr< RRArray< Y > > RobotRaconteur::VectorToRRArray ( const std::vector< U > & in)
static

Convert a std::vector to an RRArray<Y>.

boost::numeric_cast<Y>() is used to convert between numeric types

Template Parameters
YThe type of the output RRArray elements
UThe type of the input std::vector elements
Parameters
inThe input std::vector to be converted
Returns
RR_INTRUSIVE_PTR<RRArray<Y> > The output RRArray filled with the values converted from in