geomc 1.0
A c++ linear algebra template library
Public Member Functions | Public Attributes | List of all members
WrappedStorage< T, N > Struct Template Reference

Array storage with templated static or dynamic size, acting as a thin, templated wrapper around a bare array which is memory managed by the caller. More...

#include <geomc/Storage.h>

Inheritance diagram for WrappedStorage< T, N >:
GenericStorage< T, N, STORAGE_WRAPPED >

Public Member Functions

 WrappedStorage (index_t sz, T *srcdata)
 Construct a new WrappedStorage and use srcdata as the backing memory.
 
T * get ()
 Return a pointer to the first element in the storage array.
 
const T * get () const
 Return a const pointer to the first element in the storage array.
 
index_t size () const
 Return the number of elements in the array.
 
T & operator[] (index_t idx)
 Return a reference to the ith element in the array.
 
operator[] (index_t idx) const
 Return the ith element in the array.
 

Public Attributes

T * data
 
Dimension< N >::storage_t dim
 

Detailed Description

template<typename T, index_t N>
struct geom::WrappedStorage< T, N >

Array storage with templated static or dynamic size, acting as a thin, templated wrapper around a bare array which is memory managed by the caller.

Template Parameters
TElement type.
NSize of the array, or 0 for dynamic size.

This class is mainly used for when ownership semantics are templated.

#include <geomc/Storage.h>


The documentation for this struct was generated from the following file: