70 const T*
begin()
const;
82 const T&
operator[](
size_t localIndex )
const;
87 const T* m_buffer =
nullptr;
107 size_t elementSize()
const;
119 void resize(
size_t size,
size_t elementSize );
129 const void* rwPtr()
const;
135 const T* ptr()
const;
158 size_t m_elementSize;
165 : m_buffer( (const T*)buffer )
197 return m_buffer[ localIndex ];
207 return m_elementSize;
241 agxAssert1(
sizeof( T ) == m_elementSize,
"ptrAs<T> type size mismatch." );
242 return (
const T*)m_buffer;
247 size_t numElements )
const
249 if ( m_buffer ==
nullptr )
252 if ( startIndex >=
m_size )
256 numElements =
m_size > startIndex ?
m_size - startIndex : 0u;
258 return { &(this->
template ptr<T>()[ startIndex ]), numElements };
261 inline BinaryOutputBuffer::BinaryOutputBuffer()
262 : m_buffer( nullptr )
264 , m_elementSize( 0u )
268 inline BinaryOutputBuffer::~BinaryOutputBuffer()
Buffer used for sensor output of a wide range of output element types.
BinaryOutputView< T > view(size_t startIndex=0u, size_t numElements=agx::InvalidIndex) const
Create a view into a section of the buffer.
size_t elementSize() const
void resize(size_t size, size_t elementSize)
Resize the buffer to fit the given number of elements of the given size.
View for reading sections of a binary packed buffer of the specified template parameter type.
BinaryOutputView()=default
Constructs a default empty binary output view.
const T & operator[](size_t localIndex) const
Random read access of value at the specified index.
#define agxAssert1(expr, msg)
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agxSensor namespace contains components to model real-time sensors connected to the physics of AG...
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
std::random_access_iterator_tag iterator_category
std::ptrdiff_t difference_type