fesa-core  4.2.0
fesa::Array< T, runtimeCheck > Class Template Reference

A one-dimensional array wrapper class. An Array always has its own copy of the data. Consequently, the data passed to its constructor can be safely destroyed. An Array provides a subscript operator which allows modification of the data. More...

#include <Array.h>

Inheritance diagram for fesa::Array< T, runtimeCheck >:
fesa::ImmutableArray< T, runtimeCheck >

Public Member Functions

 Array (const T *data, std::size_t nElements)
 Construct a new Array by copying the data from the memory pointed to by 'data'. More...
 
- Public Member Functions inherited from fesa::MutableArray< T, runtimeCheck >
 MutableArray (const T *data, std::size_t nElements)
 Construct a new MutableArray by copying the data from the memory pointed to by 'data'. More...
 
template<typename S >
T & operator[] (S index)
 
- Public Member Functions inherited from fesa::ImmutableArray< T, runtimeCheck >
 ImmutableArray (const T *data, std::size_t nElements)
 
 ImmutableArray (const T *first, const T *last)
 
 ImmutableArray (const std::vector< T > &values)
 
 ImmutableArray ()
 
 operator const T * () const
 
const T & operator[] (S index) const
 
Array< T, runtimeCheck > getMutable () const
 
std::size_t size () const
 

Additional Inherited Members

- Protected Attributes inherited from fesa::ImmutableArray< T, runtimeCheck >
std::size_t nElements_
 The number of elements of this ImmutableArray.
 
const T * data_
 The pointer to the elements of this ImmutableArray.
 

Detailed Description

template<typename T, bool runtimeCheck = true>
class fesa::Array< T, runtimeCheck >

A one-dimensional array wrapper class. An Array always has its own copy of the data. Consequently, the data passed to its constructor can be safely destroyed. An Array provides a subscript operator which allows modification of the data.

Template Parameters
TThe type of the elements
runtimeCheckTo check or not to check index boundaries at runtime

Constructor & Destructor Documentation

template<typename T , bool runtimeCheck>
fesa::Array< T, runtimeCheck >::Array ( const T *  data,
std::size_t  nElements 
)

Construct a new Array by copying the data from the memory pointed to by 'data'.

Parameters
dataThe pointer to the memory that contains the array's data
nElementsThe number of array's elements

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