Domi
Multi-dimensional, distributed data structures
|
A ConcreteSlice is a Slice that does not accept Default or negative start or stop values. More...
#include <Domi_Slice.hpp>
Public Member Functions | |
ConcreteSlice (dim_type stopVal) | |
One argument constructor. More... | |
ConcreteSlice (dim_type startVal, dim_type stopVal, dim_type stepVal=1) | |
Two or three argument constructor. More... | |
virtual | ~ConcreteSlice () |
Destructor. | |
Slice | bounds (dim_type size) const |
Simply return this ConcreteSlice. | |
Public Member Functions inherited from Domi::Slice | |
std::string | toString () const |
Return a string representation of the Slice. More... | |
Slice () | |
Default constructor. More... | |
Slice (dim_type stopVal) | |
One argument constructor. More... | |
Slice (dim_type startVal, dim_type stopVal, dim_type stepVal=1) | |
Two or three argument constructor. More... | |
Slice (const Slice &source) | |
Copy constructor. | |
virtual | ~Slice () |
Destructor. | |
const dim_type | start () const |
Start index. More... | |
const dim_type | stop () const |
Stop index. More... | |
const dim_type | step () const |
Step interval. More... | |
Slice & | operator= (const Slice &source) |
Assignment operator. | |
bool | operator== (const Slice &slice) const |
Equals operator. | |
bool | operator!= (const Slice &slice) const |
Inequality operator. | |
Additional Inherited Members | |
Public Types inherited from Domi::Slice | |
typedef Domi::dim_type | dim_type |
The type for start indexes, stop indexes, and step intervals. | |
Static Public Attributes inherited from Domi::Slice | |
static const dim_type | Default |
Default value for Slice constructors. More... | |
A ConcreteSlice is a Slice that does not accept Default or negative start or stop values.
By ensuring that the start, stop and step values are all concrete, the bounds() method can just return *this, which is much more efficient than the base class Slice implementation of bounds().
It is not expected that the end user should ever have to deal directly with ConcreteSlice. The Slice bounds() method returns a Slice object that is in fact a ConcreteSlice. Any further calls to bounds() will therefore be efficient.
Domi::ConcreteSlice::ConcreteSlice | ( | dim_type | stopVal | ) |
Two or three argument constructor.
startVal | [in] The start index of the slice. |
stopVal | [in] The stop index of the slice. |
stepVal | [in] The step interval of the slice. |
Returns Slice with start == startVal
, step == stopVal
, step == stepVal
(default 1).