std::slice Class Reference

Class defining one-dimensional subset of an array. More...

#include <slice_array.h>

List of all members.

Public Member Functions

 slice ()
 Construct an empty slice.

 slice (size_t, size_t, size_t)
 Construct a slice.

size_t start () const
 Return array offset of first slice element.

size_t size () const
 Return size of slice.

size_t stride () const
 Return array stride of slice.


Private Attributes

size_t _M_off
size_t _M_sz
size_t _M_st


Detailed Description

Class defining one-dimensional subset of an array.

The slice class represents a one-dimensional subset of an array, specified by three parameters: start offset, size, and stride. The start offset is the index of the first element of the array that is part of the subset. The size is the total number of elements in the subset. Stride is the distance between each successive array element to include in the subset.

For example, with an array of size 10, and a slice with offset 1, size 3 and stride 2, the subset consists of array elements 1, 3, and 5.

Definition at line 58 of file slice_array.h.


Constructor & Destructor Documentation

std::slice::slice  )  [inline]
 

Construct an empty slice.

Definition at line 89 of file slice_array.h.

std::slice::slice size_t  ,
size_t  ,
size_t 
[inline]
 

Construct a slice.

Parameters:
o Offset in array of first element.
d Number of elements in slice.
s Stride between array elements.

Definition at line 92 of file slice_array.h.


Member Function Documentation

size_t std::slice::size  )  const [inline]
 

Return size of slice.

Definition at line 100 of file slice_array.h.

Referenced by std::_SBase< _Dom >::size().

size_t std::slice::start  )  const [inline]
 

Return array offset of first slice element.

Definition at line 96 of file slice_array.h.

Referenced by std::_SBase< _Dom >::operator[]().

size_t std::slice::stride  )  const [inline]
 

Return array stride of slice.

Definition at line 104 of file slice_array.h.

References _M_st.

Referenced by std::_SBase< _Dom >::operator[]().


Member Data Documentation

size_t std::slice::_M_off [private]
 

Definition at line 81 of file slice_array.h.

size_t std::slice::_M_st [private]
 

Definition at line 83 of file slice_array.h.

Referenced by stride().

size_t std::slice::_M_sz [private]
 

Definition at line 82 of file slice_array.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 30 17:32:15 2007 for GNU C++ STL by doxygen 1.3.6