RTC Toolkit 6.0.0-pre2
Loading...
Searching...
No Matches
rtctk::componentFramework::detail::UserTypeHandler< rtctk::componentFramework::test::ThrowInMakeSpan > Struct Reference

#include <repositoryIfTestSuite.hpp>

Public Types

using BufferType = test::ThrowInMakeSpan
 
using ElementType = char
 
using DataPointType = RtcString
 
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]

◆ DataPointType [1/2]

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

◆ DataPointType [2/2]

◆ ElementType [1/2]

Defines the element type of the buffer object.

◆ ElementType [2/2]

◆ TempBufferType [1/2]

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

◆ TempBufferType [2/2]

Member Function Documentation

◆ CopyFromTempBuffer()

static void rtctk::componentFramework::detail::UserTypeHandler< rtctk::componentFramework::test::ThrowInMakeSpan >::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< rtctk::componentFramework::test::ThrowInMakeSpan >::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]

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]

◆ MakeSpan() [1/4]

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]

◆ MakeSpan() [3/4]

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]

◆ ResizeBuffer() [1/2]

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]

Member Data Documentation

◆ USES_TEMP_BUFFER [1/2]

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

◆ USES_TEMP_BUFFER [2/2]


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