Jive reference manual
List of all members | Public Member Functions
jem::SliceTo Class Reference

A class for creating a contiguous slice that starts at the beginning of an array-like object. More...

#include <jem/base/Slice.h>

Inheritance diagram for jem::SliceTo:
Inheritance graph

Public Member Functions

 SliceTo (int last)
 Creates a SliceTo with a given end index. More...
 
- Public Member Functions inherited from jem::SliceFromTo
 SliceFromTo (int first, int last)
 Creates a SliceFromTo with a given begin index and end index. More...
 
- Public Member Functions inherited from jem::Slice
 Slice ()
 Creates an empty Slice. More...
 
 Slice (int first, int last, int stride=1)
 Constructs a Slice with a given begin index, end index and stride. More...
 
int first () const
 Returns the begin index. More...
 
int last () const
 Returns the end index. More...
 
int last (int ubound) const
 Returns a clipped end index. More...
 
int stride () const
 Returns the stride. More...
 

Additional Inherited Members

- Static Public Attributes inherited from jem::Slice
static const int MAX_INDEX
 The largest representable integer. More...
 

Detailed Description

A SliceTo is basically a SliceFromTo with a begin index equal to zero. A SliceTo is normally created by calling the global function slice().

See also
slice().

Constructor & Destructor Documentation

jem::SliceTo::SliceTo ( int  last)

Creates a SliceTo with a given end index. The end index may not be larger than the size of the array-like object from which a slice is to be taken.

Parameters
last- the end index.
Precondition
last >= 0
Postcondition
this->first() == 0 &&
this->last() == last &&
this->stride() == 1