| |
The k-dimensional key type.
| |
| |
The k-dimensional interval type.
| |
| |
The type in dimension , with .
| |
| |
function object providing an
operator() that takes an argument of type Key and returns
a component of type Key_i.
| |
| |
function object providing an
operator() that takes an argument of type Interval and returns
a component of type Key_i.
| |
| |
function object providing an
operator() that takes an argument of type Interval and returns
a component of type Key_i.
| |
| |
function object providing an
operator() that takes two arguments argument , of type Key_i and returns
true if , false otherwise.
|
The following piece of code gives an example of how a traits class might look like, if you have keys that are of the type int in the first and that are of the type double in the second dimension.
class Int_double_tree_traits_2{ public: typedef std::pair<int, double> Key; typedef int Key_1; typedef double Key_2; typedef std::pair<Key,Key> Interval; class _Key_1{ public: Key_1 operator()(const Key& k) { return k.first;} }; class _Key_2{ public: Key_2 operator()(const Key& k) { return k.second;} }; class _Low_1{ public: Key_1 operator()(const Interval& i) { return i.first.first;} }; class _High_1{ public: Key_1 operator()(const Interval& i) { return i.second.first;} }; class _Low_2{ public: Key_2 operator()(const Interval& i) { return i.first.second;} }; class _High_2{ public: Key_2 operator()(const Interval& i) { return i.second.second;} }; class _Compare_1{ public: bool operator()(Key_1 k1, Key_1 k2) { return less<int>()(k1,k2);} }; class _Compare_2{ public: bool operator()(Key_2 k1, Key_2 k2) { return less<double>()(k1,k2);} }; typedef _Compare_1 compare_1; typedef _Compare_2 compare_2; typedef _Low_1 low_1; typedef _High_1 high_1; typedef _Key_1 key_1; typedef _Low_2 low_2; typedef _High_2 high_2; typedef _Key_2 key_2; };