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

Multidimensional namedarray random access memory region. More...

#include <MemoryMember.h>

Inheritance diagram for RobotRaconteur::NamedMultiDimArrayMemory< T >:
RobotRaconteur::MultiDimArrayMemoryBase

Public Member Functions

 NamedMultiDimArrayMemory ()
 Construct a new NamedMultiDimArrayMemory instance.
 NamedMultiDimArrayMemory (const boost::intrusive_ptr< RRNamedMultiDimArray< T > > &multimemory)
 Construct a new NamedMultiDimArrayMemory instance attached to an RRNamedMultiDimArrayPtr<T>.
virtual void Attach (const boost::intrusive_ptr< RRNamedMultiDimArray< T > > &multimemory)
 Attach NamedMultiDimArrayMemory instance to an RRNamedMultiDimArrayPtr<T>.
RR_OVIRTUAL std::vector< uint64_t > Dimensions () RR_OVERRIDE
 Dimensions of the memory array.
RR_OVIRTUAL uint64_t DimCount () RR_OVERRIDE
 The number of dimensions in the memory array.
virtual void Read (const std::vector< uint64_t > &memorypos, boost::intrusive_ptr< RRNamedMultiDimArray< T > > &buffer, const std::vector< uint64_t > &bufferpos, const std::vector< uint64_t > &count)
 Read a block from a multidimensional array memory.
virtual void Write (const std::vector< uint64_t > &memorypos, const boost::intrusive_ptr< RRNamedMultiDimArray< T > > &buffer, const std::vector< uint64_t > &bufferpos, const std::vector< uint64_t > &count)
 Write a segment to a multidimensional array memory.

Detailed Description

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

Multidimensional namedarray random access memory region.

Memories represent random access memory regions that are typically represented as arrays of various shapes and types. Memories can be declared in service definition files using the memory member keyword within service definitions. Services expose memories to clients, and the nodes will proxy read, write, and parameter requests between the client and service. The node will also break up large requests to avoid the message size limit of the transport.

The NamedMultiDimArrayMemory class is used to represent a multidimensional named array. Single dimensional named arrays should use NamedArrayMemory. Type T must be declared in a service definition using the namedarray keyword, and generated using RobotRaconteurGen.

NamedMultiDimArrayMemory instances are attached to an RRNamedMultiDimArrayPtr<T>, either when constructed or later using Attach().

NamedMultiDimArrayMemory instances returned by clients are special implementations designed to proxy requests to the service. They cannot be attached to an arbitrary array.

Template Parameters
TThe namedarray type of the array

Constructor & Destructor Documentation

◆ NamedMultiDimArrayMemory() [1/2]

template<typename T>
RobotRaconteur::NamedMultiDimArrayMemory< T >::NamedMultiDimArrayMemory ( )
inline

Construct a new NamedMultiDimArrayMemory instance.

New instance will not be attached to an array.

NamedMultiDimArrayMemory must be constructed with boost::make_shared<NamedMultiDimArrayMemory<T> >();

◆ NamedMultiDimArrayMemory() [2/2]

template<typename T>
RobotRaconteur::NamedMultiDimArrayMemory< T >::NamedMultiDimArrayMemory ( const boost::intrusive_ptr< RRNamedMultiDimArray< T > > & multimemory)
inline

Construct a new NamedMultiDimArrayMemory instance attached to an RRNamedMultiDimArrayPtr<T>.

New instance will be constructed attached to an array.

NamedMultiDimArrayMemory must be constructed with boost::make_shared<NamedMultiDimArrayMemory<T> >();

Parameters
multimemoryThe array to attach

Member Function Documentation

◆ Attach()

template<typename T>
virtual void RobotRaconteur::NamedMultiDimArrayMemory< T >::Attach ( const boost::intrusive_ptr< RRNamedMultiDimArray< T > > & multimemory)
inlinevirtual

Attach NamedMultiDimArrayMemory instance to an RRNamedMultiDimArrayPtr<T>.

Parameters
multimemoryThe array to attach

◆ DimCount()

template<typename T>
RR_OVIRTUAL uint64_t RobotRaconteur::NamedMultiDimArrayMemory< T >::DimCount ( )
inlinevirtual

The number of dimensions in the memory array.

When used with a memory returned by a client, this function will call the service to execute the request.

Returns
uint64_t Number of dimensions

Implements RobotRaconteur::MultiDimArrayMemoryBase.

◆ Dimensions()

template<typename T>
RR_OVIRTUAL std::vector< uint64_t > RobotRaconteur::NamedMultiDimArrayMemory< T >::Dimensions ( )
inlinevirtual

Dimensions of the memory array.

Returns the dimensions (shape) of the memory array

When used with a memory returned by a client, this function will call the service to execute the request.

Returns
std::vector<uint64_t> The dimensions of the memory array

Implements RobotRaconteur::MultiDimArrayMemoryBase.

◆ Read()

template<typename T>
virtual void RobotRaconteur::NamedMultiDimArrayMemory< T >::Read ( const std::vector< uint64_t > & memorypos,
boost::intrusive_ptr< RRNamedMultiDimArray< T > > & buffer,
const std::vector< uint64_t > & bufferpos,
const std::vector< uint64_t > & count )
inlinevirtual

Read a block from a multidimensional array memory.

Read a block of a multidimensional array memory into a supplied buffer multidimensional array. The start positions and count of the read are specified.

When used with a memory returned by a client, this function will call the service to execute the request.

Parameters
memoryposThe start position in the memory array to read
bufferThe buffer to receive the read data
bufferposThe start position in the buffer to write the data
countThe count of array elements to read

◆ Write()

template<typename T>
virtual void RobotRaconteur::NamedMultiDimArrayMemory< T >::Write ( const std::vector< uint64_t > & memorypos,
const boost::intrusive_ptr< RRNamedMultiDimArray< T > > & buffer,
const std::vector< uint64_t > & bufferpos,
const std::vector< uint64_t > & count )
inlinevirtual

Write a segment to a multidimensional array memory.

Writes a segment to a multidimensional array memory from a supplied buffer multidimensional array. The start positions and count of the write are specified.

When used with a memory returned by a client, this function will call the service to execute the request.

Parameters
memoryposThe start position in the memory array to write
bufferThe buffer to write the data from
bufferposThe start position in the buffer to read the data
countThe count of array elements to write

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