![]() |
SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Lightweight, non-owning view over a contiguous sequence of elements. More...
#include <stk_common.h>
Public Member Functions | |
| ArrayView (T *ptr, size_t size) | |
| Construct an ArrayView from a raw pointer and size. | |
| T & | operator[] (size_t index) const |
| Subscript operator for element access. | |
| size_t | GetSize () const |
| Get number of elements in the view. | |
Private Attributes | |
| T * | m_ptr |
| Pointer to the underlying memory block. | |
| size_t | m_size |
| Total number of elements in the view. | |
Lightweight, non-owning view over a contiguous sequence of elements.
Usage example:
Definition at line 246 of file stk_common.h.
|
inline |
Construct an ArrayView from a raw pointer and size.
| [in] | ptr | Pointer to the first element of the contiguous memory block. |
| [in] | size | Number of elements available in the memory block. |
Definition at line 253 of file stk_common.h.
|
inline |
Get number of elements in the view.
Definition at line 271 of file stk_common.h.
References m_size.
Referenced by stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::EnumerateKernelTasks(), stk::Kernel< stk::KERNEL_DYNAMIC|stk::KERNEL_SYNC|stk::KERNEL_TICKLESS,(16U), stk::SwitchStrategyFP32, stk::PlatformDefault >::EnumerateTasks(), stk::IStackMemory::GetStackSpace(), and stk::PlatformContext::InitStackMemory().
|
inline |
Subscript operator for element access.
| index | Element index to access. |
Definition at line 261 of file stk_common.h.
References m_ptr, m_size, and STK_ASSERT.
|
private |
Pointer to the underlying memory block.
Definition at line 274 of file stk_common.h.
Referenced by ArrayView(), and operator[]().
|
private |
Total number of elements in the view.
Definition at line 275 of file stk_common.h.
Referenced by ArrayView(), GetSize(), and operator[]().