RTC Toolkit 6.0.0-pre2
Loading...
Searching...
No Matches
rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > > Struct Template Reference

Public Types

using BufferType = std::array<std::array<T, M>, N>
 
using ElementType = std::remove_cv_t<T>
 
using DataPointType = RtcMatrix<ElementType>
 
using TempBufferType = void
 
using BufferType
 Defines the type of the buffer object that handles type T.
 
using ElementType
 Defines the element type of the buffer object.
 
using DataPointType
 Defines the corresponding data point type that type T is compatible with.
 
using TempBufferType
 Defines the temporary buffer type (set to void if USES_TEMP_BUFFER is false).
 

Static Public Member Functions

static RtcVectorUInt64 GetShape (const BufferType &buffer)
 
static gsl::span< ElementTypeMakeSpan (BufferType &buffer)
 
static gsl::span< const ElementTypeMakeSpan (const BufferType &buffer)
 
static bool ResizeBuffer (BufferType &buffer, const RtcVectorUInt64 &shape)
 
static RtcVectorUInt64 GetShape (const BufferType &buffer)
 Returns the shape of a buffer object.
 
static gsl::span< ElementTypeMakeSpan (BufferType &buffer)
 Creates a span from a buffer object.
 
static gsl::span< const ElementTypeMakeSpan (const BufferType &buffer)
 Creates a span from a read-only buffer object.
 
static bool ResizeBuffer (BufferType &buffer, const RtcVectorUInt64 &shape)
 Tries to resize the buffer to the given shape.
 
static void CopyToTempBuffer (const BufferType &buffer, std::shared_ptr< TempBufferType > &temp_buffer, size_t offset, size_t count)=delete
 Copy data from the original buffer into the temporary buffer.
 
static void CopyFromTempBuffer (BufferType &buffer, const std::shared_ptr< TempBufferType > &temp_buffer, size_t offset, size_t count)=delete
 Copy data from the temporary buffer into the original buffer.
 

Static Public Attributes

static const bool USES_TEMP_BUFFER = false
 
static const bool USES_TEMP_BUFFER
 Flag indicating if a temporary buffer is required to read/write this type.
 

Member Typedef Documentation

◆ BufferType [1/2]

Defines the type of the buffer object that handles type T.

◆ BufferType [2/2]

template<typename T, std::size_t N, std::size_t M>
using rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > >::BufferType = std::array<std::array<T, M>, N>

◆ DataPointType [1/2]

Defines the corresponding data point type that type T is compatible with.

◆ DataPointType [2/2]

template<typename T, std::size_t N, std::size_t M>
using rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > >::DataPointType = RtcMatrix<ElementType>

◆ ElementType [1/2]

Defines the element type of the buffer object.

◆ ElementType [2/2]

template<typename T, std::size_t N, std::size_t M>
using rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > >::ElementType = std::remove_cv_t<T>

◆ TempBufferType [1/2]

Defines the temporary buffer type (set to void if USES_TEMP_BUFFER is false).

◆ TempBufferType [2/2]

template<typename T, std::size_t N, std::size_t M>
using rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > >::TempBufferType = void

Member Function Documentation

◆ CopyFromTempBuffer()

static void rtctk::componentFramework::detail::UserTypeHandler< T >::CopyFromTempBuffer ( BufferType & buffer,
const std::shared_ptr< TempBufferType > & temp_buffer,
size_t offset,
size_t count )
staticdelete

Copy data from the temporary buffer into the original buffer.

This method must only be implemented if USES_TEMP_BUFFER is true, i.e for types that require temporary buffers.

Note
The buffers are treated as flat arrays.
Parameters
[out]bufferThe buffer object to copy the data into.
[in]temp_bufferThe temporary buffer object from which to copy the data.
[in]offsetThe index of the first element in buffer that will be written to.
[in]countThe number of elements to copy.

◆ CopyToTempBuffer()

static void rtctk::componentFramework::detail::UserTypeHandler< T >::CopyToTempBuffer ( const BufferType & buffer,
std::shared_ptr< TempBufferType > & temp_buffer,
size_t offset,
size_t count )
staticdelete

Copy data from the original buffer into the temporary buffer.

This method must only be implemented if USES_TEMP_BUFFER is true, i.e for types that require temporary buffers.

Note
The buffers are treated as flat arrays.
Parameters
[in]bufferThe buffer object from which to copy the data.
[out]temp_bufferThe temporary buffer object to copy data into.
[in]offsetThe index of the first element in buffer to start copying.
[in]countThe number of elements to copy.

◆ GetShape() [1/2]

static RtcVectorUInt64 rtctk::componentFramework::detail::UserTypeHandler< T >::GetShape ( const BufferType & buffer)
inlinestatic

Returns the shape of a buffer object.

Parameters
[in]bufferThe buffer object for which the shape is calculated.
Returns
A list of unsigned integers indicating the number of elements for each dimension. The size of the list must equal the number of dimensions, i.e. the rank. For example, a scalar will have zero entries, a vector one entry, a matrix two.

◆ GetShape() [2/2]

template<typename T, std::size_t N, std::size_t M>
static RtcVectorUInt64 rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > >::GetShape ( const BufferType & buffer)
inlinestatic

◆ MakeSpan() [1/4]

static gsl::span< ElementType > rtctk::componentFramework::detail::UserTypeHandler< T >::MakeSpan ( BufferType & buffer)
inlinestatic

Creates a span from a buffer object.

Parameters
[in]bufferThe buffer object from which to create the span.
Returns
A span object accessing the buffer object's underlying elements.

◆ MakeSpan() [2/4]

template<typename T, std::size_t N, std::size_t M>
static gsl::span< ElementType > rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > >::MakeSpan ( BufferType & buffer)
inlinestatic

◆ MakeSpan() [3/4]

static gsl::span< const ElementType > rtctk::componentFramework::detail::UserTypeHandler< T >::MakeSpan ( const BufferType & buffer)
inlinestatic

Creates a span from a read-only buffer object.

Parameters
[in]bufferThe buffer object from which to create the span.
Returns
A span object accessing the buffer object's underlying elements.

◆ MakeSpan() [4/4]

template<typename T, std::size_t N, std::size_t M>
static gsl::span< const ElementType > rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > >::MakeSpan ( const BufferType & buffer)
inlinestatic

◆ ResizeBuffer() [1/2]

static bool rtctk::componentFramework::detail::UserTypeHandler< T >::ResizeBuffer ( BufferType & buffer,
const RtcVectorUInt64 & shape )
inlinestatic

Tries to resize the buffer to the given shape.

If possible, the buffer should be resized to contain enough space to hold the total number of elements indicated by the shape. If it is not possible to resize to the space required, then no resize should occur and false should be returned. In the case the buffer is already the correct size, resizing can be skipped and true returned, to indicate the buffer is OK.

Parameters
[in,out]bufferThe buffer object to be resized.
[in]shapeThe shape the buffer should be resized to.
Returns
true if the buffer size is correct or could be resized, and false otherwise.

◆ ResizeBuffer() [2/2]

template<typename T, std::size_t N, std::size_t M>
static bool rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > >::ResizeBuffer ( BufferType & buffer,
const RtcVectorUInt64 & shape )
inlinestatic

Member Data Documentation

◆ USES_TEMP_BUFFER [1/2]

const bool rtctk::componentFramework::detail::UserTypeHandler< T >::USES_TEMP_BUFFER
static

Flag indicating if a temporary buffer is required to read/write this type.

◆ USES_TEMP_BUFFER [2/2]

template<typename T, std::size_t N, std::size_t M>
const bool rtctk::componentFramework::detail::UserTypeHandler< std::array< std::array< T, M >, N > >::USES_TEMP_BUFFER = false
static

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