Mbed OS Reference
Loading...
Searching...
No Matches
StaticCacheAlignedBuffer< DataT, BufferSize > Class Template Reference

CacheAlignedBuffer type designed for static allocation. More...

#include <CacheAlignedBuffer.h>

Inheritance diagram for StaticCacheAlignedBuffer< DataT, BufferSize >:
CacheAlignedBuffer< DataT >

Public Member Functions

 StaticCacheAlignedBuffer ()
 Construct new cache-aligned buffer. More...
 
 StaticCacheAlignedBuffer (StaticCacheAlignedBuffer const &other)
 Copy from other cache-aligned buffer. More...
 
StaticCacheAlignedBufferoperator= (StaticCacheAlignedBuffer< DataT, BufferSize > const &other)
 Assign from other cache-aligned buffer. More...
 
DataT * data ()
 Get a pointer to the aligned data array inside the buffer. More...
 
DataT const * data () const
 Get a pointer to the aligned data array inside the buffer (const version) More...
 
DataT & operator[] (size_t index)
 Element access. More...
 
DataT operator[] (size_t index) const
 Element access (const) More...
 
iterator begin ()
 Get iterator for start of buffer. More...
 
const_iterator begin () const
 Get iterator for start of buffer. More...
 
iterator end ()
 Get iterator for end of buffer. More...
 
const_iterator end () const
 Get iterator for end of buffer. More...
 
constexpr size_t capacity ()
 

Static Protected Member Functions

static DataT * findCacheLineStart (uint8_t *buffer)
 Find and return the first location in the given buffer that starts on a cache line. More...
 

Protected Attributes

DataT * _alignedBufferPtr
 Pointer to the aligned buffer. Must be set in each constructor of each subclass. More...
 
size_t _alignedBufferCapacity
 Capacity of the aligned buffer, in terms of number of DataT elements. More...
 

Detailed Description

template<typename DataT, size_t BufferSize>
class mbed::StaticCacheAlignedBuffer< DataT, BufferSize >

CacheAlignedBuffer type designed for static allocation.

Use a StaticCacheAlignedBuffer when you want to create a cache-aligned buffer with a fixed size at compile time. StaticCacheAlignedBuffers can be declared globally, as local variables, or using new[] and delete[].

Template Parameters
DataTType of the data to store in the buffer. Note: CacheAlignedBuffer is not designed for using class types as DataT, and will not call constructors.
BufferSizeBuffer size (number of elements) needed by the application for the buffer.

Definition at line 235 of file CacheAlignedBuffer.h.