Rosetta
|
Class Array0 is a c-style array wrapper that does bounds checking in debug mode. It indexes from 0 just like regular c-arrays. Class Array0 does not manage it's own memory. It does not allocate memory if you want to make it larger, nor does it deallocate memory when you destroy it. Bounds checking only ensures that the user does not go outside of the memory Array0 thinks it's in charge of. If the user should happen to point the array0 at memory that has not been allocated, Array0 is not responsible for segmentation fault that will likely occur. Garbage in, garbage out. More...
#include <ArrayPool.hh>
Public Member Functions | |
Array0 () | |
Default ctor points at null. More... | |
Array0 (T *mem_begin, platform::Size size) | |
Array and size constructor – point this Array0 at a block of memory. More... | |
Array0 (Array0< T > const &other) | |
Copy constructor – point this Array0 at a block of memory. More... | |
Array0< T > const & | operator= (Array0< T > const &rhs) |
Assignment operator – point this Array0 at a different block of memory. More... | |
~Array0 ()=default | |
The destructor does not deallocate the memory that this Array0 points at. That is the responsibility of some other class. Array0 is for bounds checking only. More... | |
T & | operator[] (platform::Size index) |
Accessors and mutators. More... | |
T const & | operator[] (platform::Size index) const |
T & | operator[] (int index) |
T const & | operator[] (int index) const |
platform::Size | size () const |
Private Member Functions | |
bool | bounds_check (platform::Size index) const |
bool | bounds_check (int index) const |
Private Attributes | |
T * | array_ |
platform::Size | size_ |
Class Array0 is a c-style array wrapper that does bounds checking in debug mode. It indexes from 0 just like regular c-arrays. Class Array0 does not manage it's own memory. It does not allocate memory if you want to make it larger, nor does it deallocate memory when you destroy it. Bounds checking only ensures that the user does not go outside of the memory Array0 thinks it's in charge of. If the user should happen to point the array0 at memory that has not been allocated, Array0 is not responsible for segmentation fault that will likely occur. Garbage in, garbage out.
|
inline |
Default ctor points at null.
|
inline |
Array and size constructor – point this Array0 at a block of memory.
|
inline |
Copy constructor – point this Array0 at a block of memory.
|
default |
|
inlineprivate |
References enumerate_junctions::int, and utility::graph::Array0< T >::size_.
|
inlineprivate |
References utility::graph::Array0< T >::size_.
Referenced by utility::graph::Array0< T >::operator[]().
|
inline |
Assignment operator – point this Array0 at a different block of memory.
References utility::graph::Array0< T >::array_, and utility::graph::Array0< T >::size_.
|
inline |
|
inline |
|
inline |
Accessors and mutators.
References utility::graph::Array0< T >::array_, utility::graph::Array0< T >::bounds_check(), and debug_assert.
|
inline |
|
inline |
References utility::graph::Array0< T >::size_.
|
private |
Referenced by utility::graph::Array0< T >::operator=(), and utility::graph::Array0< T >::operator[]().
|
private |