Scopira  20080306
scopira::basekit::narray_o< T, DIM > Class Template Reference

#include <narray.h>

Inheritance diagram for scopira::basekit::narray_o< T, DIM >:
scopira::basekit::narray< T, DIM > scopira::tool::object

Public Member Functions

 narray_o (void)
 default
 
 narray_o (const this_type &src)
 copy ctor
 
 narray_o (const narray_parent_type &src)
 copy ctor
 
 narray_o (const nindex< DIM > &sz)
 sizing
 
 narray_o (size_t width, size_t height)
 sizing
 
virtual bool load (scopira::tool::iobjflow_i &in)
 
virtual void save (scopira::tool::oobjflow_i &out) const
 
void operator= (const this_type &at)
 this turns out to be very handy
 
- Public Member Functions inherited from scopira::basekit::narray< T, DIM >
 narray (void)
 in direct mode? if non null, this will be the handler More...
 
 narray (const this_type &src)
 copy ctor
 
 narray (const index_type &sz)
 sizing
 
 narray (size_t width, size_t height)
 sizing
 
 ~narray (void)
 dtor
 
bool load (scopira::tool::itflow_i &in)
 
void save (scopira::tool::otflow_i &out) const
 
const T * c_array (void) const
 raw c-array style access
 
T * c_array (void)
 raw c-array style access
 
iterator begin (void)
 begin-stl like iterator
 
iterator end (void)
 end-stl like iterator
 
const_iterator begin (void) const
 begin-stl like iterator
 
const_iterator end (void) const
 end-stl like iterator
 
bool empty (void) const
 empty?
 
size_t size (void) const
 gets the size (1D)
 
size_t width (void) const
 width
 
size_t height (void) const
 height
 
size_t depth (void) const
 depth
 
const index_typedimen (void) const
 gets the size of this array
 
void resize (size_t len)
 
void resize (size_t neww, size_t newh)
 
void resize (size_t neww, size_t newh, size_t newd)
 
void resize (const index_type &news)
 
void resize_direct (index_type sz, T *direct_ary, scopira::basekit::narray_delete_i *delfunc=null_narray_delete)
 
scopira::basekit::narray_delete_iget_direct (void) const
 gets the direct status/handler. non-null for direct mode
 
template<int SIM>
nslice< T, SIM > slicer (index_type base, nindex< SIM > dimen, nindex< SIM > direction)
 main slicer
 
template<int SIM>
nslice< T, SIM > slicer (index_type base, nindex< SIM > dimen)
 default directions
 
nslice< T, 1 > slicer (index_type base, size_t len, size_t direction=x_axis_c)
 1D specialized slicer, just to be nice
 
nslice< T, 1 > diagonal_slice (void)
 
nslice< T, DIM > all_slice (void)
 all slice
 
size_t size_rows (void) const
 number of rows
 
nslice< T, DIM-1 > row_slice (size_t r)
 get a particular row
 
nslice< T, 1 > xslice (size_t basex, size_t len)
 vector to vector
 
nslice< T, 1 > xslice (size_t basex, size_t basey, size_t len)
 vector slice
 
nslice< T, 1 > yslice (size_t basex, size_t basey, size_t len)
 vector slice
 
nslice< T, 2 > xyslice (size_t basex, size_t basey, size_t width, size_t height)
 matrix slice
 
nslice< T, 1 > xslice (index_type base, size_t len)
 vector slice
 
nslice< T, 1 > yslice (index_type base, size_t len)
 vector slice
 
nslice< T, 1 > zslice (index_type base, size_t len)
 vector slice
 
nslice< T, 1 > tslice (index_type base, size_t len)
 vector slice
 
nslice< T, 2 > xyslice (index_type base, size_t width, size_t height)
 matrix slice
 
template<int SIM>
const_nslice< T, SIM > slicer (index_type base, nindex< SIM > dimen, nindex< SIM > direction) const
 main slicer
 
template<int SIM>
const_nslice< T, SIM > slicer (index_type base, nindex< SIM > dimen) const
 default directions
 
const_nslice< T, 1 > slicer (index_type base, size_t len, size_t direction=x_axis_c) const
 1D specialized slicer, just to be nice
 
const_nslice< T, 1 > diagonal_slice (void) const
 diagnol
 
const_nslice< T, DIM > all_slice (void) const
 all slice
 
const_nslice< T, DIM-1 > row_slice (size_t r) const
 number of rows More...
 
const_nslice< T, 1 > xslice (size_t basex, size_t len) const
 vector to vector
 
const_nslice< T, 1 > xslice (size_t basex, size_t basey, size_t len) const
 vector slice
 
const_nslice< T, 1 > yslice (size_t basex, size_t basey, size_t len) const
 vector slice
 
const_nslice< T, 2 > xyslice (size_t basex, size_t basey, size_t width, size_t height) const
 matrix slice
 
const_nslice< T, 1 > xslice (index_type base, size_t len) const
 vector slice
 
const_nslice< T, 1 > yslice (index_type base, size_t len) const
 vector slice
 
const_nslice< T, 1 > zslice (index_type base, size_t len) const
 vector slice
 
const_nslice< T, 1 > tslice (index_type base, size_t len) const
 vector slice
 
const_nslice< T, 2 > xyslice (index_type base, size_t width, size_t height) const
 matrix slice
 
void clear (void)
 set all to 0
 
void set_all (T v)
 set all the elements
 
void copy (const this_type &at)
 deep copy
 
void copy (const nslice< T, DIM > &at)
 deep copy
 
void copy (const const_nslice< T, DIM > &at)
 deep copy
 
void operator= (const this_type &at)
 this turns out to be very handy
 
operator() (index_type c) const
 [] ref
 
T & operator() (index_type c)
 [] ref
 
void set (index_type c, T v)
 setter
 
get (index_type c) const
 getter
 
const T operator[] (size_t idx) const
 Nice, referece-based element access.
 
T & operator[] (size_t idx)
 Nice, referece-based element access.
 
void set (size_t idx, T v)
 Sets the value of an element.
 
get (size_t idx) const
 Gets the value of an element.
 
const T operator() (size_t x, size_t y) const
 
T & operator() (size_t x, size_t y)
 
void set (size_t x, size_t y, T v)
 
get (size_t x, size_t y) const
 
T & operator() (size_t x, size_t y, size_t z)
 
void set (size_t x, size_t y, size_t z, T v)
 
get (size_t x, size_t y, size_t z) const
 
template<int SIM>
scopira::basekit::nslice< T, SIM > slicer (index_type base, nindex< SIM > dimen, nindex< SIM > direction)
 
template<int SIM>
scopira::basekit::nslice< T, SIM > slicer (index_type base, nindex< SIM > dimen)
 
template<int SIM>
scopira::basekit::const_nslice< T, SIM > slicer (index_type base, nindex< SIM > dimen, nindex< SIM > direction) const
 
template<int SIM>
scopira::basekit::const_nslice< T, SIM > slicer (index_type base, nindex< SIM > dimen) const
 
- Public Member Functions inherited from scopira::tool::object
virtual ~object ()
 
int add_ref (void) const
 
bool sub_ref (void) const
 
void auto_ref (void) const
 
int current_ref (void) const
 
virtual scopira::tool::oflow_iprint (scopira::tool::oflow_i &o) const
 
bool is_alive_object (void) const
 
bool is_dead_object (void) const
 

Additional Inherited Members

- Public Types inherited from scopira::basekit::narray< T, DIM >
typedef T data_type
 the type of the elements in the narray
 
typedef nindex< DIM > index_type
 the index type that this narray likes (usually an nindex type)
 
typedef T * iterator
 the interator type
 
typedef const T * const_iterator
 the const_interator type
 
typedef T value_type
 
typedef T * pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
- Protected Member Functions inherited from scopira::tool::object
 object (void)
 
 object (bool neverusecounter)
 

Detailed Description

template<class T, int DIM>
class scopira::basekit::narray_o< T, DIM >

This is a descendant of narray that also decends from object thereby adding ref counting and registered serialization abilitites.

The following variants of this type have been registered for serialization:

Author
Aleksander Demko

Member Function Documentation

◆ load()

template<class T, int DIM>
virtual bool scopira::basekit::narray_o< T, DIM >::load ( scopira::tool::iobjflow_i in)
inlinevirtual

Serialization loader. Tells the object to load its state information from the given stream. object's load however, should not be called. It will assert failure if it is mistakenly called (which is often the base when one tries to serialize a class which lacks its own load method)

Parameters
inthe stream to load from
Returns
true on success
Author
Aleksander Demko

Reimplemented from scopira::tool::object.

◆ save()

template<class T, int DIM>
virtual void scopira::basekit::narray_o< T, DIM >::save ( scopira::tool::oobjflow_i out) const
inlinevirtual

Serialization saver. Writes the object's state information to the given stream. object's save however, should not be called. It will assert failure if it is mistakenly called (which is often the base when one tries to serialize a class which lacks its own save method)

Parameters
outthe stream to write to
Author
Aleksander Demko

Reimplemented from scopira::tool::object.


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