#include <interval.h>
Public Types | |
typedef long | data_t |
Public Member Functions | |
~interval () | |
interval () | |
interval (const interval &rhs) | |
interval (data_t first, data_t last) | |
interval & | operator= (const interval &rhs) |
bool | valid () const |
void | clear () |
interval | operator+ (const interval &rhs) const |
void | operator+= (const interval &rhs) |
interval | operator* (const interval &rhs) const |
void | operator*= (const interval &rhs) |
interval | operator- (const interval &rhs) const |
void | operator-= (const interval &rhs) |
bool | member (data_t datum) const |
void | scan_begin () |
bool | scan_next (data_t &datum) |
void | scan_end () |
bool | empty () const |
data_t | first () const |
data_t | last () const |
data_t | second_last () const |
Private Member Functions | |
void | append (data_t datum) |
void | normalize () |
Private Attributes | |
size_t | length |
size_t | size |
size_t | scan_index |
data_t | scan_next_datum |
data_t * | data |
Definition at line 32 of file interval.h.
typedef long interval::data_t |
Definition at line 35 of file interval.h.
interval::~interval | ( | ) |
The destructor.
interval::interval | ( | ) |
The default constructor. This constructs the empty interval.
interval::interval | ( | const interval & | rhs | ) |
The copy constructor.
bool interval::valid | ( | ) | const |
The valid method is used when debugging, to ensure that the interval's internal state is self-consistent.
void interval::clear | ( | ) |
The clear method is used to discard all contents of the interval. It will be empty on return.
The addition operator is used to calculate the union of two intervals.
rhs | The right hand side of the addition expression. |
void interval::operator+= | ( | const interval & | rhs | ) |
The multiplication operator is used to calculate the intersection of two intervals.
rhs | The right hand side of the multiplication expression. |
void interval::operator*= | ( | const interval & | rhs | ) |
The subtraction operator is used to calculate the difference of two intervals.
rhs | The right hand side of the subtraction expression. |
void interval::operator-= | ( | const interval & | rhs | ) |
bool interval::member | ( | data_t | datum | ) | const |
void interval::scan_begin | ( | ) |
bool interval::scan_next | ( | data_t & | datum | ) |
void interval::scan_end | ( | ) |
bool interval::empty | ( | ) | const [inline] |
The empty method is used to determine whether or not the interval is empty.
Definition at line 144 of file interval.h.
data_t interval::first | ( | ) | const |
data_t interval::last | ( | ) | const |
data_t interval::second_last | ( | ) | const |
void interval::append | ( | data_t | datum | ) | [private] |
The append method is used to add another datum to the data. It shall always be called in pairs. The first of every pair will result in an internal state which fails the valid() test.
void interval::normalize | ( | ) | [private] |
size_t interval::length [private] |
Definition at line 177 of file interval.h.
size_t interval::size [private] |
Definition at line 178 of file interval.h.
size_t interval::scan_index [private] |
Definition at line 179 of file interval.h.
data_t interval::scan_next_datum [private] |
Definition at line 180 of file interval.h.
data_t* interval::data [private] |
Definition at line 181 of file interval.h.