1234567891011121314151617181920212223242526 |
- //
- // Created by zx on 2020/7/10.
- //
- #ifndef NNXX_TESTS_MESSAGE_COMPARE_H__H
- #define NNXX_TESTS_MESSAGE_COMPARE_H__H
- #define RegistoryCompare(NAMESPACE,NAME) \
- namespace NAMESPACE \
- { \
- static bool operator==(const NAME& msg1,const NAME& msg2){ \
- if(msg1.base_info().msg_type() == msg2.base_info().msg_type() \
- && msg1.base_info().sender() == msg2.base_info().sender() \
- && msg1.base_info().receiver() == msg2.base_info().receiver() \
- && msg1.command_id() == msg2.command_id()){ \
- return true; \
- }else{ \
- return false; \
- } \
- } \
- static bool operator<(const NAME& msg1,const NAME& msg2){ \
- return msg1.command_id() < msg2.command_id(); \
- } \
- }
- #endif //NNXX_TESTS_MESSAGE_COMPARE_H
|