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...
 
Tvalue & first ()
 access start of range More...
 
Tvalue & last ()
 access end of range More...
 
const Tvalue & first () const
 read start of range More...
 
const Tvalue & last () 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...
 
Range & shrink (const Range &other)
 shrink to smaller of this and the other More...
 
Range & expand (const Range &other)
 expand to larger of this and the other More...
 
Range & shift (const Tvalue &n)
 shift by n More...
 
Range & operator+= (const Tvalue &n)
 shift by n More...
 
Range & operator-= (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: