source: source/ariba/utility/addressing/detail/compare_to_operators.hpp@ 12748

Last change on this file since 12748 was 5284, checked in by mies, 15 years ago

+ added new transport modules and adapted ariba to them
+ exchange endpoint descriptors an link establishment
+ clean up of base communication
+ link establishment with in the presence of multiple endpoints
+ local discovery for ipv6, ipv4 and bluetooth mac addresses

File size: 1.4 KB
Line 
1#ifndef COMPARE_TO_OPERATORS_HPP_
2#define COMPARE_TO_OPERATORS_HPP_
3
4namespace ariba {
5namespace addressing {
6namespace detail {
7
8
9/**
10 * This class implements some convenient operators for the compare_to method.
11 *
12 * @author Sebastian Mies <mies@tm.uka.de>
13 */
14template<class T>
15class compare_to_operators {
16public:
17 /// convenience method for comparison of addresses
18 inline bool operator==( const T& rhs ) const {
19 return static_cast<const T*>(this)->compare_to(rhs) == 0;
20 }
21
22 /// convenience method for comparison of addresses
23 inline bool operator!=( const T& rhs ) const {
24 return static_cast<const T*>(this)->compare_to(rhs) != 0;
25 }
26
27 /// convenience method for comparison of addresses
28 inline bool operator<( const T& rhs ) const {
29 return static_cast<const T*>(this)->compare_to(rhs) < 0;
30 }
31
32 /// convenience method for comparison of addresses
33 inline bool operator<=( const T& rhs ) const {
34 return static_cast<const T*>(this)->compare_to(rhs) <= 0;
35 }
36
37 /// convenience method for comparison of addresses
38 inline bool operator>( const T& rhs ) const {
39 return static_cast<const T*>(this)->compare_to(rhs) > 0;
40 }
41
42 /// convenience method for comparison of addresses
43 inline bool operator>=( const T& rhs ) const {
44 return static_cast<const T*>(this)->compare_to(rhs) >= 0;
45 }
46};
47
48}}} // namespace ariba::addressing::detail
49
50#endif /* COMPARE_TO_OPERATORS_HPP_ */
Note: See TracBrowser for help on using the repository browser.