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

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

#include <MemoryMember.h>

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

Public Member Functions

 NamedArrayMemory ()
 Construct a new NamedArrayMemory instance.
 NamedArrayMemory (const boost::intrusive_ptr< RRNamedArray< T > > &memory)
 Construct a new NamedArrayMemory instance attached to an RRNamedArrayPtr<T>.
virtual void Attach (const boost::intrusive_ptr< RRNamedArray< T > > &memory)
 Attach NamedArrayMemory instance to an RRNamedArrayPtr<T>.
RR_OVIRTUAL uint64_t Length () RR_OVERRIDE
 Return the length of the array memory.
virtual void Read (uint64_t memorypos, boost::intrusive_ptr< RRNamedArray< 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< RRNamedArray< T > > &buffer, uint64_t bufferpos, uint64_t count)
 Write a segment to an array memory.

Detailed Description

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

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

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

NamedArrayMemory 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

◆ NamedArrayMemory() [1/2]

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

Construct a new NamedArrayMemory instance.

New instance will not be attached to an array.

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

◆ NamedArrayMemory() [2/2]

template<typename T>
RobotRaconteur::NamedArrayMemory< T >::NamedArrayMemory ( const boost::intrusive_ptr< RRNamedArray< T > > & memory)
inline

Construct a new NamedArrayMemory instance attached to an RRNamedArrayPtr<T>.

New instance will be constructed attached to an array.

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

Parameters
memoryThe array to attach

Member Function Documentation

◆ Attach()

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

Attach NamedArrayMemory instance to an RRNamedArrayPtr<T>.

Parameters
memoryThe array to attach

◆ Length()

template<typename T>
RR_OVIRTUAL uint64_t RobotRaconteur::NamedArrayMemory< 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::NamedArrayMemory< T >::Read ( uint64_t memorypos,
boost::intrusive_ptr< RRNamedArray< 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::NamedArrayMemory< T >::Write ( uint64_t memorypos,
const boost::intrusive_ptr< RRNamedArray< 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: