TF++, Miscellaneous classes and modules in C++:
tfxx::Range< T > Class Template Reference

A class to deal with numerical ranges. More...

#include <range.h>

Inheritance diagram for tfxx::Range< T >:
Collaboration diagram for tfxx::Range< T >:

Public Types

typedef T Tvalue
 element type More...
 

Public Member Functions

 Range ()
 empty range More...
 
 Range (const Tvalue &index)
 range containing exactly one element More...
 
 Range (const Tvalue &first, const Tvalue &last)
 set range More...
 
Tvaluefirst ()
 access start of range More...
 
Tvaluelast ()
 access end of range More...
 
const Tvaluefirst () const
 read start of range More...
 
const Tvaluelast () const
 read end of range More...
 
bool isinside (const Range &other) const
 is this range inside the other More...
 
bool contains (const Range &other) const
 does this range contain the other More...
 
bool contains (const Tvalue &v) const
 does this range contain then value v More...
 
Rangeshrink (const Range &other)
 shrink to smaller of this and the other More...
 
Rangeexpand (const Range &other)
 expand to larger of this and the other More...
 
Rangeshift (const Tvalue &n)
 shift by n More...
 
Rangeoperator+= (const Tvalue &n)
 shift by n More...
 
Rangeoperator-= (const Tvalue &n)
 shift by -n More...
 

Private Attributes

Tvalue Mfirst
 start of range. More...
 
Tvalue Mlast
 end of range. More...
 

Detailed Description

template<class T = int>
class tfxx::Range< T >

A class to deal with numerical ranges.

Parameters
Ttype of value (default=int)

Definition at line 50 of file range.h.


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