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

Single dimensional pod random access memory region. More...

#include <MemoryMember.h>

Inheritance diagram for RobotRaconteur::PodArrayMemory< T >:
RobotRaconteur::ArrayMemoryBase

Public Member Functions

 PodArrayMemory ()
 Construct a new PodArrayMemory instance.
 PodArrayMemory (const boost::intrusive_ptr< RRPodArray< T > > &memory)
 Construct a new PodArrayMemory instance attached to an RRPodArrayPtr<T>.
virtual void Attach (const boost::intrusive_ptr< RRPodArray< T > > &memory)
 Attach PodArrayMemory instance to an RRPodArrayPtr<T>.
RR_OVIRTUAL uint64_t Length () RR_OVERRIDE
 Return the length of the array memory.
virtual void Read (uint64_t memorypos, boost::intrusive_ptr< RRPodArray< T > > &buffer, uint64_t bufferpos, uint64_t count)
 Read a segment from an array memory.
virtual void Write (uint64_t memorypos, const boost::intrusive_ptr< RRPodArray< T > > &buffer, uint64_t bufferpos, uint64_t count)
 Write a segment to an array memory.

Detailed Description

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

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

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

PodArrayMemory 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

◆ PodArrayMemory() [1/2]

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

Construct a new PodArrayMemory instance.

New instance will not be attached to an array.

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

◆ PodArrayMemory() [2/2]

template<typename T>
RobotRaconteur::PodArrayMemory< T >::PodArrayMemory ( const boost::intrusive_ptr< RRPodArray< T > > & memory)
inline

Construct a new PodArrayMemory instance attached to an RRPodArrayPtr<T>.

New instance will be constructed attached to an array.

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

Parameters
memoryThe array to attach

Member Function Documentation

◆ Attach()

template<typename T>
virtual void RobotRaconteur::PodArrayMemory< T >::Attach ( const boost::intrusive_ptr< RRPodArray< T > > & memory)
inlinevirtual

Attach PodArrayMemory instance to an RRPodArrayPtr<T>.

Parameters
memoryThe array to attach

◆ Length()

template<typename T>
RR_OVIRTUAL uint64_t RobotRaconteur::PodArrayMemory< T >::Length ( )
inlinevirtual

Return the length of the array memory.

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

Returns
uint64_t The length of the array memory

Implements RobotRaconteur::ArrayMemoryBase.

◆ Read()

template<typename T>
virtual void RobotRaconteur::PodArrayMemory< T >::Read ( uint64_t memorypos,
boost::intrusive_ptr< RRPodArray< T > > & buffer,
uint64_t bufferpos,
uint64_t count )
inlinevirtual

Read a segment from an array memory.

Read a segment of an array memory into a supplied buffer array. The start positions and length 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 index in the memory array to read
bufferThe buffer to receive the read data
bufferposThe start index in the buffer to write the data
countThe number of array elements to read

◆ Write()

template<typename T>
virtual void RobotRaconteur::PodArrayMemory< T >::Write ( uint64_t memorypos,
const boost::intrusive_ptr< RRPodArray< T > > & buffer,
uint64_t bufferpos,
uint64_t count )
inlinevirtual

Write a segment to an array memory.

Writes a segment to an array memory from a supplied buffer array. The start positions and length 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 index in the memory array to write
bufferThe buffer to write the data from
bufferposThe start index in the buffer to read the data
countThe number of array elements to write

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