Robot Raconteur Core C++ Library
Loading...
Searching...
No Matches
RobotRaconteur::RRArray< T > Class Template Reference

Numeric primitive or character array value type. More...

#include <DataTypes.h>

Inheritance diagram for RobotRaconteur::RRArray< T >:
RobotRaconteur::RRBaseArray RobotRaconteur::MessageElementData RobotRaconteur::RRValue

Public Types

typedef T value_type
typedef T * iterator
typedef const T * const_iterator
typedef T & reference
typedef const T & const_reference
typedef std::size_t size_type
typedef std::ptrdiff_t difference_type
typedef boost::reverse_iterator< iteratorreverse_iterator
typedef boost::reverse_iterator< const_iteratorconst_reverse_iterator

Public Member Functions

RR_OVIRTUAL void * void_ptr () RR_OVERRIDE
 Get a void pointer to the contained array.
RR_OVIRTUAL size_t size () RR_OVERRIDE
 Get the number of elements in the array.
RR_OVIRTUAL size_t ElementSize () RR_OVERRIDE
 Get the number of bytes per element of the array.
iterator begin ()
 returns an iterator to the beginning
const_iterator begin () const
 returns an iterator to the beginning
const_iterator cbegin () const
 returns a const iterator to the beginning
iterator end ()
 returns an iterator to the end
const_iterator end () const
 returns an iterator to the end
const_iterator cend () const
 returns a const iterator to the end
reverse_iterator rbegin ()
 returns a reverse iterator to the beginning
const_reverse_iterator rbegin () const
 returns a reverse iterator to the beginning
const_reverse_iterator crbegin () const
 returns a reverse iterator to the beginning
reverse_iterator rend ()
 returns a reverse iterator to the end
const_reverse_iterator rend () const
 returns a reverse iterator to the end
const_reverse_iterator crend () const
 returns a reverse iterator to the end
reference operator[] (size_type i)
 access specified element
const_reference operator[] (size_type i) const
 access specified element
reference at (size_type i)
 access specified element with bounds checking
const_reference at (size_type i) const
 access specified element with bounds checking
reference front ()
 access the first element
const_reference front () const
 access the first element
reference back ()
 access the last element
const_reference back () const
 access the last element
bool empty ()
 checks whether the container is empty
size_type max_size ()
 returns the maximum possible number of elements
const T * data () const
 direct access to the underlying array
T * data ()
 direct access to the underlying array
template<typename T2>
RRArray< T > & operator= (const RRArray< T2 > &rhs)
 assignment with type conversion
void assign (const T &value)
 Assign one value to all elements.
void fill (const T &value)
 Fill array with value.

Detailed Description

template<typename T>
class RobotRaconteur::RRArray< T >

Numeric primitive or character array value type.

This class stores a numeric primitive or character array. Arrays should always be allocated using AllocateRRArray<T>(), AttachRRArray<T>(), AttachRRArrayCopy<T>(), AllocateRRArrayByType<T>(), or AllocateEmptyRRArray<T>()

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.

RRArray must be stored in RR_INTRUSIVE_PTR. It will be deleted automatically when the reference count goes to zero.

Template Parameters
TThe type of the array elements

Member Typedef Documentation

◆ const_iterator

template<typename T>
typedef const T* RobotRaconteur::RRArray< T >::const_iterator

◆ const_reference

template<typename T>
typedef const T& RobotRaconteur::RRArray< T >::const_reference

◆ const_reverse_iterator

template<typename T>
typedef boost::reverse_iterator<const_iterator> RobotRaconteur::RRArray< T >::const_reverse_iterator

◆ difference_type

template<typename T>
typedef std::ptrdiff_t RobotRaconteur::RRArray< T >::difference_type

◆ iterator

template<typename T>
typedef T* RobotRaconteur::RRArray< T >::iterator

iterator

◆ reference

template<typename T>
typedef T& RobotRaconteur::RRArray< T >::reference

reference

◆ reverse_iterator

template<typename T>
typedef boost::reverse_iterator<iterator> RobotRaconteur::RRArray< T >::reverse_iterator

◆ size_type

template<typename T>
typedef std::size_t RobotRaconteur::RRArray< T >::size_type

◆ value_type

template<typename T>
typedef T RobotRaconteur::RRArray< T >::value_type

Member Function Documentation

◆ assign()

template<typename T>
void RobotRaconteur::RRArray< T >::assign ( const T & value)
inline

Assign one value to all elements.

Synonym for fill()

Parameters
valueThe value to assign all elements

◆ ElementSize()

template<typename T>
RR_OVIRTUAL size_t RobotRaconteur::RRArray< T >::ElementSize ( )
inlinevirtual

Get the number of bytes per element of the array.

Returns
size_t

Implements RobotRaconteur::RRBaseArray.

◆ fill()

template<typename T>
void RobotRaconteur::RRArray< T >::fill ( const T & value)
inline

Fill array with value.

Parameters
valueThe value to fill array with

◆ operator=()

template<typename T>
template<typename T2>
RRArray< T > & RobotRaconteur::RRArray< T >::operator= ( const RRArray< T2 > & rhs)
inline

assignment with type conversion

Template Parameters
T2The type of the input array
Parameters
rhsThe input array to assign (and copy) to this array
Returns
RRArray<T>& reference to this array

◆ size()

template<typename T>
RR_OVIRTUAL size_t RobotRaconteur::RRArray< T >::size ( )
inlinevirtual

Get the number of elements in the array.

Returns
size_t

Implements RobotRaconteur::RRBaseArray.

◆ void_ptr()

template<typename T>
RR_OVIRTUAL void * RobotRaconteur::RRArray< T >::void_ptr ( )
inlinevirtual

Get a void pointer to the contained array.

Returns
void*

Implements RobotRaconteur::RRBaseArray.


The documentation for this class was generated from the following file: