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

Array storage with templated static or dynamic size. If the array is dynamic, its length is stored internally and can be queried. More...

#include <geomc/Storage.h>

Inheritance diagram for SizedStorage< T, N >:
Storage< T, N >

Public Member Functions

 SizedStorage ()
 Construct a new SizedStorage of size N. (Static size only).
 
 SizedStorage (index_t n)
 Construct a new SizedStorage of size n. n is ignored if the array size is not dynamic.
 
index_t size () const
 Return the number of elements in the array.
 
T * get ()
 Return a pointer to the first element in the storage array.
 
const T * get () const
 Return a pointer to the first (const) element in the storage array.
 
T & operator[] (index_t i)
 Return a reference to the ith element in the array.
 
operator[] (index_t i) const
 Return the ith element in the array.
 

Public Attributes

data [N]
 Data array. Reference-counted if N is 0 (dynamic).
 

Detailed Description

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

Array storage with templated static or dynamic size. If the array is dynamic, its length is stored internally and can be queried.

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

#include <geomc/Storage.h>


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