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

Multidimensional pod random access memory region. More...

#include <MemoryMember.h>

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

Public Member Functions

 PodMultiDimArrayMemory ()
 Construct a new PodMultiDimArrayMemory instance.
 PodMultiDimArrayMemory (const boost::intrusive_ptr< RRPodMultiDimArray< T > > &multimemory)
 Construct a new PodMultiDimArrayMemory instance attached to an RRPodMultiDimArrayPtr<T>.
virtual void Attach (const boost::intrusive_ptr< RRPodMultiDimArray< T > > &multimemory)
 Attach PodMultiDimArrayMemory instance to an RRPodMultiDimArrayPtr<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< RRPodMultiDimArray< 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< RRPodMultiDimArray< 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::PodMultiDimArrayMemory< T >

Multidimensional pod 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 PodMultiDimArrayMemory class is used to represent a multidimensional pod array. Single dimensional pod arrays should use PodArrayMemory. Type T must be declared in a service definition using the pod keyword, and generated using RobotRaconteurGen.

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

PodMultiDimArrayMemory 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 pod type of the array

Constructor & Destructor Documentation

◆ PodMultiDimArrayMemory() [1/2]

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

Construct a new PodMultiDimArrayMemory instance.

New instance will not be attached to an array.

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

◆ PodMultiDimArrayMemory() [2/2]

template<typename T>
RobotRaconteur::PodMultiDimArrayMemory< T >::PodMultiDimArrayMemory ( const boost::intrusive_ptr< RRPodMultiDimArray< T > > & multimemory)
inline

Construct a new PodMultiDimArrayMemory instance attached to an RRPodMultiDimArrayPtr<T>.

New instance will be constructed attached to an array.

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

Parameters
multimemoryThe array to attach

Member Function Documentation

◆ Attach()

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

Attach PodMultiDimArrayMemory instance to an RRPodMultiDimArrayPtr<T>.

Parameters
multimemoryThe array to attach

◆ DimCount()

template<typename T>
RR_OVIRTUAL uint64_t RobotRaconteur::PodMultiDimArrayMemory< 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::PodMultiDimArrayMemory< 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::PodMultiDimArrayMemory< T >::Read ( const std::vector< uint64_t > & memorypos,
boost::intrusive_ptr< RRPodMultiDimArray< 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::PodMultiDimArrayMemory< T >::Write ( const std::vector< uint64_t > & memorypos,
const boost::intrusive_ptr< RRPodMultiDimArray< 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: