|
gslcpp
Modern-C++ Wrapper for GSL
|
Specialization, which is interface to storage with two key properties: (1) that size of storage is determined dynamically, at run-time, and (2) that it is owned by instance of interface. More...
#include <v-stor.hpp>
Public Member Functions | |
| v_stor (size_t n, alloc_type a=ALLOC) | |
| Allocate vector and its descriptor. More... | |
| bool | valid () const |
| True if object's data have been validly allocated. More... | |
| auto * | v () |
| Reference to GSL's interface to vector. More... | |
| const auto * | v () const |
| Reference to GSL's interface to vector. More... | |
| v_stor (v_stor &&src) | |
| Move on construction. More... | |
| virtual | ~v_stor () |
| Deallocate vector and its descriptor. | |
Protected Member Functions | |
| void | free () |
| Deallocate vector and its descriptor. | |
| w_vector< T > * | allocate (size_t n, alloc_type a) |
| Allocate vector and its descriptor. More... | |
Protected Attributes | |
| w_vector< T > * | v_ = nullptr |
| Pointer to allocated descriptor for vector. | |
Private Member Functions | |
| v_stor (v_stor const &)=delete | |
| Disable copy-construction. | |
| v_stor & | operator= (v_stor const &)=delete |
| Disable copy-assignment. | |
Specialization, which is interface to storage with two key properties: (1) that size of storage is determined dynamically, at run-time, and (2) that it is owned by instance of interface.
Generic gsl::v_stor<T,S> is for storage-size S determined at compile-time.
Move-construction is provided, but move-assignment is not. Once memory is allocated for a vector, that memory and only that memory belongs to the vector until it is destroyed.
| T | Type of each element in vector. |
Definition at line 68 of file v-stor.hpp.
|
inline |
Allocate vector and its descriptor.
| n | Number of elements in vector. |
| a | Method to use for allocation. |
Definition at line 96 of file v-stor.hpp.
|
inline |
Move on construction.
Constructor is not template because moving works only from other v_stor.
| src | Vector to move. |
Definition at line 113 of file v-stor.hpp.
|
inlineprotected |
Allocate vector and its descriptor.
| n | Number of elements in vector. |
| a | Type of allocation (simple or initialized to zero). |
Definition at line 86 of file v-stor.hpp.
|
inline |
Reference to GSL's interface to vector.
Definition at line 104 of file v-stor.hpp.
|
inline |
Reference to GSL's interface to vector.
Definition at line 108 of file v-stor.hpp.
|
inline |
True if object's data have been validly allocated.
Definition at line 100 of file v-stor.hpp.
1.8.17