Implements fixed-size storage.
More...
#include <siplasplas/typeerasure/anystorage/fixedsize.hpp>
|
const char * | begin () const |
| Returns a pointer to the beginning of the storage.
|
|
char * | begin () |
| Returns a pointer to the beginning of the storage.
|
|
const char * | end () const |
| Returns a pointer to the end of the storage.
|
|
char * | end () |
| Returns a pointer to the end of the storage.
|
|
constexpr std::size_t | size () const |
| Returns the size in bytes of the storage.
|
|
const void * | storage (cpp::typeerasure::TypeInfo typeInfo) const |
| Returns a pointer to the storage memory space. More...
|
|
void * | storage (cpp::typeerasure::TypeInfo typeInfo) |
| Returns a pointer to the storage memory space. More...
|
|
template<typename T > |
bool | objectFitsInStorage () const |
| Checks if an object can be hosted in the storage space. More...
|
|
template<std::size_t Size, std::size_t Alignment = alignof(std::uint8_t)>
class cpp::FixedSizeStorage< Size, Alignment >
Implements fixed-size storage.
- Template Parameters
-
Size | Max capacity of the storage |
Alignment | Storage alignment. Alignof(std::uint8_t ) by default |
template<std::size_t Size, std::size_t Alignment = alignof(std::uint8_t)>
template<typename T >
Checks if an object can be hosted in the storage space.
- Returns
- True if properly-aligned values of type T fit in the storage, false otherwise
template<std::size_t Size, std::size_t Alignment = alignof(std::uint8_t)>
Returns a pointer to the storage memory space.
- Parameters
-
typeInfo | Type information with the required alignment and storage size |
- Returns
- An aligned pointer to the storage. The behavior is undefined if the storage has no space to host an object with the required alignment (See objectFitsInStorage()).
template<std::size_t Size, std::size_t Alignment = alignof(std::uint8_t)>
Returns a pointer to the storage memory space.
- Parameters
-
typeInfo | Type information with the required alignment and storage size |
- Returns
- An aligned pointer to the storage. The behavior is undefined if the storage has no space to host an object with the required alignment (See objectFitsInStorage()).
The documentation for this class was generated from the following file: