|
7 | 7 | // We remove the one that is not used in the user API |
8 | 8 | // We also remove all the related operators |
9 | 9 | %ignore eprosima::fastrtps::rtps::Time_t; |
| 10 | +%ignore eprosima::fastrtps::rtps::operator==(const Time_t&, const Time_t&); |
| 11 | +%ignore eprosima::fastrtps::rtps::operator!=(const Time_t&, const Time_t&); |
| 12 | +%ignore eprosima::fastrtps::rtps::operator<(const Time_t&, const Time_t&); |
| 13 | +%ignore eprosima::fastrtps::rtps::operator<=(const Time_t&, const Time_t&); |
| 14 | +%ignore eprosima::fastrtps::rtps::operator>(const Time_t&, const Time_t&); |
| 15 | +%ignore eprosima::fastrtps::rtps::operator>=(const Time_t&, const Time_t&); |
| 16 | +%ignore eprosima::fastrtps::rtps::operator+(const Time_t&, const Time_t&); |
| 17 | +%ignore eprosima::fastrtps::rtps::operator-(const Time_t&, const Time_t&); |
10 | 18 | %ignore eprosima::fastrtps::rtps::operator<<(std::ostream&, const Time_t&); |
11 | 19 | %ignore eprosima::fastrtps::rtps::operator>>(std::ostream&, const Time_t&); |
12 | 20 |
|
|
15 | 23 | %ignore eprosima::fastrtps::operator<<(std::ostream&, const Time_t&); |
16 | 24 | %ignore eprosima::fastrtps::operator>>(std::ostream&, const Time_t&); |
17 | 25 |
|
| 26 | +// Ignore the global comparison and arithmetic operators |
| 27 | +// and make them class-internal |
| 28 | +%ignore eprosima::fastrtps::operator==(const Time_t&, const Time_t&); |
| 29 | +%ignore eprosima::fastrtps::operator!=(const Time_t&, const Time_t&); |
| 30 | +%ignore eprosima::fastrtps::operator<(const Time_t&, const Time_t&); |
| 31 | +%ignore eprosima::fastrtps::operator<=(const Time_t&, const Time_t&); |
| 32 | +%ignore eprosima::fastrtps::operator>(const Time_t&, const Time_t&); |
| 33 | +%ignore eprosima::fastrtps::operator>=(const Time_t&, const Time_t&); |
| 34 | +%ignore eprosima::fastrtps::operator+(const Time_t&, const Time_t&); |
| 35 | +%ignore eprosima::fastrtps::operator-(const Time_t&, const Time_t&); |
| 36 | + |
18 | 37 | %include "fastdds/rtps/common/Time_t.h" |
| 38 | + |
| 39 | +// Declare the comparison operators as internal to the class |
| 40 | +%extend eprosima::fastrtps::Time_t { |
| 41 | + bool operator==(const eprosima::fastrtps::Time_t& other) const |
| 42 | + { |
| 43 | + return *$self == other; |
| 44 | + } |
| 45 | + |
| 46 | + bool operator!=(const eprosima::fastrtps::Time_t& other) const |
| 47 | + { |
| 48 | + return *$self != other; |
| 49 | + } |
| 50 | + |
| 51 | + bool operator<(const eprosima::fastrtps::Time_t& other) const |
| 52 | + { |
| 53 | + return *$self < other; |
| 54 | + } |
| 55 | + |
| 56 | + bool operator>(const eprosima::fastrtps::Time_t& other) const |
| 57 | + { |
| 58 | + return *$self > other; |
| 59 | + } |
| 60 | + |
| 61 | + bool operator<=(const eprosima::fastrtps::Time_t& other) const |
| 62 | + { |
| 63 | + return *$self <= other; |
| 64 | + } |
| 65 | + |
| 66 | + bool operator>=(const eprosima::fastrtps::Time_t& other) const |
| 67 | + { |
| 68 | + return *$self >= other; |
| 69 | + } |
| 70 | + |
| 71 | + eprosima::fastrtps::Time_t operator+ (const eprosima::fastrtps::Time_t& other) const |
| 72 | + { |
| 73 | + return *$self + other; |
| 74 | + } |
| 75 | + |
| 76 | + eprosima::fastrtps::Time_t operator- (const eprosima::fastrtps::Time_t& other) const |
| 77 | + { |
| 78 | + return *$self - other; |
| 79 | + } |
| 80 | +} |
| 81 | + |
0 commit comments