|
Aegis
4.25.D505
|
#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 |
The interval class is used to represent disjoint intervals of an integer type. The expected interval arithmtic operators (union, intersect and difference) are supported.
Definition at line 30 of file interval.h.
| typedef long interval::data_t |
Definition at line 33 of file interval.h.
The destructor.
The default constructor. This constructs the empty interval.
| interval::interval | ( | const interval & | rhs | ) |
The copy constructor.
| interval::interval | ( | data_t | first, |
| data_t | last | ||
| ) |
The constructor. It is used to construct a continuous interval with no holes. The arguments are inclusive.
| first | The first element in the interval. |
| last | The last element in the interval. |
| 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::clear | ( | ) |
The clear method is used to discard all contents of the interval. It will be empty on return.
| bool interval::empty | ( | void | ) | const [inline] |
The empty method is used to determine whether or not the interval is empty.
Definition at line 142 of file interval.h.
| data_t interval::first | ( | ) | const |
The first member is used to obtain the value of the first value in the interval.
| data_t interval::last | ( | ) | const |
The last member is used to obtain the value of the last value in the interval.
| bool interval::member | ( | data_t | datum | ) | const |
The member method is used to determine whether or not the given datum is a member of the interval.
| datum | The datum to look for in the interval. |
| void interval::normalize | ( | ) | [private] |
The normalize method is used to restore the interval to a valid() state after calculating a union, intersection or difference.
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 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 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 | ) |
| void interval::scan_begin | ( | ) |
| void interval::scan_end | ( | ) |
| bool interval::scan_next | ( | data_t & | datum | ) |
| data_t interval::second_last | ( | ) | const |
The second_last member is used to obtain the value of the first member of the contiguous portion of this interval.
| bool interval::valid | ( | ) | const |
The valid method is used when debugging, to ensure that the interval's internal state is self-consistent.
data_t* interval::data [private] |
Definition at line 179 of file interval.h.
size_t interval::length [private] |
Definition at line 175 of file interval.h.
size_t interval::scan_index [private] |
Definition at line 177 of file interval.h.
data_t interval::scan_next_datum [private] |
Definition at line 178 of file interval.h.
size_t interval::size [private] |
Definition at line 176 of file interval.h.
1.7.6.1