|
casacore
|
This class emplements a static (but run-time) sized array. More...
#include <Storage.h>
Classes | |
| struct | disjunction |
| Used by template code above These are already in C++17, but currently only using C++11... More... | |
| struct | disjunction< B1 > |
| struct | disjunction< B1, Bn... > |
| struct | conjunction |
| struct | conjunction< B1 > |
| struct | conjunction< B1, Bn... > |
Public Member Functions | |
| Storage () | |
| Construct an empty Storage. | |
| Storage (std::size_t n) | |
| Construct Storage with a given size. | |
| Storage (std::size_t n, const T &val) | |
| Construct Storage with a given size. | |
| template<typename InputIterator> | |
| Storage (InputIterator startIter, InputIterator endIter) | |
| Construct Storage from a range. | |
| ~Storage () noexcept | |
| Destructs the elements and deallocates the data. | |
| T * | data () |
| Return a pointer to the storage data. | |
| const T * | data () const |
| size_t | size () const |
| Size of the data, zero if empty. | |
| bool | is_shared () const |
| Whether this Storage owns its data. | |
| Storage (const Storage< T > &)=delete | |
| Storage (Storage< T > &&)=delete | |
| Storage & | operator= (const Storage &)=delete |
| Storage & | operator= (Storage &&)=delete |
Static Public Member Functions | |
| static std::unique_ptr< Storage< T > > | MakeFromMove (T *startIter, T *endIter) |
| Construct Storage from a range by moving. | |
| static std::unique_ptr< Storage< T > > | MakeFromSharedData (T *existingData, size_t n) |
| Construct a Storage from existing data. | |
| static std::unique_ptr< Storage< T > > | MakeUninitialized (size_t n) |
| Construct a Storage with uninitialized data. | |
Private Member Functions | |
| Storage (T *startIter, T *endIter, std::false_type, std::true_type) | |
| Moving range constructor implementation. | |
| template<typename InputIterator> | |
| Storage (InputIterator startIter, InputIterator endIter, std::false_type) | |
| Copying range constructor implementation for non-integral types. | |
| template<typename Integral> | |
| Storage (Integral n, Integral val, std::true_type) | |
| Copying range constructor implementation for integral types. | |
| T * | construct (size_t n) |
| These methods allocate the storage and construct the elements. | |
| T * | construct (size_t n, const T &val) |
| template<typename InputIterator> | |
| T * | construct_range (InputIterator startIter, InputIterator endIter) |
| T * | construct_move (T *startIter, T *endIter) |
Private Attributes | |
| T * | _data |
| T * | _end |
| bool | _isShared |
This class emplements a static (but run-time) sized array.
It is used in the Array class, and is necessary because std::vector specializes for bool. It holds the same functionality as a normal array, and enables allocation through different allocators similar to std::vector.
|
inline |
Construct an empty Storage.
Definition at line 20 of file Storage.h.
References _data, _end, and _isShared.
Referenced by MakeFromMove(), MakeFromSharedData(), MakeUninitialized(), operator=(), operator=(), Storage(), Storage(), and Storage().
|
inline |
|
inline |
|
inline |
Construct Storage from a range.
The elements will be copy constructed from the given values. Note that this constructor can be chosen over of Storage(std::size_t, const T&, const Alloc) when T=size_t. Therefore, this constructor forwards to the appropriate constructor based on whether T is an integral.
Definition at line 49 of file Storage.h.
References Storage().
|
inlinenoexcept |
|
delete |
References Storage().
|
delete |
References Storage().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
Return a pointer to the storage data.
Definition at line 106 of file Storage.h.
References _data.
Referenced by construct(), construct(), construct_move(), and construct_range().
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
delete |
References Storage().
|
delete |
References Storage().
|
inline |
Size of the data, zero if empty.
Definition at line 111 of file Storage.h.
Referenced by ~Storage().
|
private |
|
private |
|
private |
Definition at line 270 of file Storage.h.
Referenced by is_shared(), Storage(), Storage(), Storage(), Storage(), Storage(), Storage(), and ~Storage().