UFO
ufo::ConstrainedRange Class Reference

A range of indices. More...

#include <ConstrainedRange.h>

Public Member Functions

 ConstrainedRange (int size=0)
 Create an unconstrained range of size size. More...
 
int begin () const
 Return the index of the first element in the range. More...
 
int end () const
 Return the index of the element past the end of the range. More...
 
int size () const
 Return the range length. More...
 
bool empty () const
 Return true if the range is empty, false otherwise. More...
 
void constrain (int newBegin, int newEnd)
 Constrain the range. More...
 
void reset ()
 Remove any constraints, resetting the range to its original size. More...
 

Private Attributes

int size_
 
int begin_
 
int end_
 

Detailed Description

A range of indices.

Definition at line 16 of file ConstrainedRange.h.

Constructor & Destructor Documentation

◆ ConstrainedRange()

ufo::ConstrainedRange::ConstrainedRange ( int  size = 0)
inlineexplicit

Create an unconstrained range of size size.

Definition at line 19 of file ConstrainedRange.h.

Here is the call graph for this function:

Member Function Documentation

◆ begin()

int ufo::ConstrainedRange::begin ( ) const
inline

Return the index of the first element in the range.

Definition at line 24 of file ConstrainedRange.h.

Here is the caller graph for this function:

◆ constrain()

void ufo::ConstrainedRange::constrain ( int  newBegin,
int  newEnd 
)
inline

Constrain the range.

Definition at line 34 of file ConstrainedRange.h.

Here is the caller graph for this function:

◆ empty()

bool ufo::ConstrainedRange::empty ( ) const
inline

Return true if the range is empty, false otherwise.

Definition at line 31 of file ConstrainedRange.h.

◆ end()

int ufo::ConstrainedRange::end ( ) const
inline

Return the index of the element past the end of the range.

Definition at line 26 of file ConstrainedRange.h.

Here is the caller graph for this function:

◆ reset()

void ufo::ConstrainedRange::reset ( )
inline

Remove any constraints, resetting the range to its original size.

Definition at line 42 of file ConstrainedRange.h.

Here is the caller graph for this function:

◆ size()

int ufo::ConstrainedRange::size ( ) const
inline

Return the range length.

Definition at line 29 of file ConstrainedRange.h.

Member Data Documentation

◆ begin_

int ufo::ConstrainedRange::begin_
private

Definition at line 49 of file ConstrainedRange.h.

◆ end_

int ufo::ConstrainedRange::end_
private

Definition at line 50 of file ConstrainedRange.h.

◆ size_

int ufo::ConstrainedRange::size_
private

Definition at line 48 of file ConstrainedRange.h.


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