a container for fixed or dynamically sized arrays, with an upper bounds limit for safety
More...
#include <serdes_format_modifiers.h>
|
| template<size_t max_elements> |
| constexpr | array (T(&v)[max_elements], const ST &s) noexcept |
| | Construct a new array object from an existing array and a referenced size. More...
|
| |
| template<size_t max_elements> |
| constexpr | array (T(&v)[max_elements], const ST &&s) noexcept |
| | Construct a new array object from an existing array and a rvalue size. More...
|
| |
| constexpr | array (T *v, ST &s, const ST max_elements) noexcept |
| | Construct a new array object from a pointer to the head of the array, a referenced dynamic size, and a constant max size. More...
|
| |
| constexpr | array (T *v, const ST &&s, const ST max_elements) noexcept |
| | Construct a new array object from a pointer to the head of the array, a rvalue dynamic size, and a constant max size. More...
|
| |
| | array (T &v, const ST &s) noexcept |
| | Construct a new "dynamically" sized array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list) More...
|
| |
| | array (T &v, const ST &&s) noexcept |
| | Construct a new "fixed" sized array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list) More...
|
| |
| | array (T &v) noexcept |
| | Construct a new "fixed" sized array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list) More...
|
| |
|
|
elem_type * | value |
| | a pointer to the array head
|
| |
|
const ST | rvalue_size |
| | holds onto an rvalue size if provide (so that const ST &size can have a local reference)
|
| |
|
const ST & | size |
| | a reference to a value that contains the dynamic size of the array for fixed sized arrays (where the size term is a rvalue temp), size will just refer to max_size since they're the same in that case if rvalue <= size, otherwise max will be set to 0 to force as size error
|
| |
|
const size_t | max_size |
| | maximum size of the array (used for bounds checking)
|
| |
template<typename T, typename ST>
struct serdes::array< T, ST >
a container for fixed or dynamically sized arrays, with an upper bounds limit for safety
- Template Parameters
-
| T | the array element type |
| ST | the type of the variable used by reference to adjust and report the array size |
- Examples
- 06_variable_length_formats.cpp, 13_arrays_of_packets.cpp, and 14_custom_types.cpp.
◆ elem_type
template<typename T , typename ST >
if the array is from a container with a "P* T.data()" method, elem_type will be P otherwise, elem_type will be T, allowing support for c-arrays (no data method) and std::array, std::list, std::vector, etc. (any c-array abstraction layer with a data() method)
◆ array() [1/7]
template<typename T , typename ST >
template<size_t max_elements>
Construct a new array object from an existing array and a referenced size.
- Template Parameters
-
| max_elements | maximum number of elements in the array |
- Parameters
-
| v | reference to the underlying array |
| s | reference to a value representing the dynamic array size |
◆ array() [2/7]
template<typename T , typename ST >
template<size_t max_elements>
Construct a new array object from an existing array and a rvalue size.
- Template Parameters
-
- Parameters
-
| v | reference to the underlying array |
| s | a rvalue representing the dynamic array size |
◆ array() [3/7]
template<typename T , typename ST >
Construct a new array object from a pointer to the head of the array, a referenced dynamic size, and a constant max size.
- Parameters
-
| v | pointer to the head of the array |
| s | reference to a value representing the dynamic array size |
| max_elements | maximum size of the array |
◆ array() [4/7]
template<typename T , typename ST >
Construct a new array object from a pointer to the head of the array, a rvalue dynamic size, and a constant max size.
- Parameters
-
| v | pointer to the head of the array |
| s | rvalue representing the dynamic array size |
| max_elements | maximum size of the array |
◆ array() [5/7]
template<typename T , typename ST >
Construct a new "dynamically" sized array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list)
- Parameters
-
| v | reference to the data container whose underlying data should be used as the array |
| s | reference to a value representing the "dynamic" array size |
◆ array() [6/7]
template<typename T , typename ST >
Construct a new "fixed" sized array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list)
- Parameters
-
| v | reference to the data container whose underlying data should be used as the array |
| s | rvalue representing the "fixed" array size |
◆ array() [7/7]
template<typename T , typename ST >
Construct a new "fixed" sized array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list)
- Parameters
-
| v | reference to the data container whose underlying data should be used as the array |
The documentation for this struct was generated from the following file: