Goby Underwater Autonomy Project
Series: 1.1, revision: 163, released on 2013-02-06 14:23:27 -0500
|
00001 // copyright 2011 t. schneider tes@mit.edu 00002 // 00003 // goby-acomms is a collection of libraries 00004 // for acoustic underwater networking 00005 // 00006 // This program is free software: you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation, either version 3 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // This software is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with this software. If not, see <http://www.gnu.org/licenses/>. 00018 #ifndef AcommsProtoHelpers20110117H 00019 #define AcommsProtoHelpers20110117H 00020 00021 #include <sstream> 00022 00023 #include "goby/protobuf/modem_message.pb.h" 00024 #include "goby/protobuf/queue.pb.h" 00025 #include "goby/util/time.h" 00026 00027 namespace goby 00028 { 00029 namespace acomms 00030 { 00031 namespace protobuf 00032 { 00033 00034 inline bool operator<(const goby::acomms::protobuf::QueueKey& a, 00035 const goby::acomms::protobuf::QueueKey& b) 00036 { return (a.id() == b.id()) ? a.type() < b.type() : a.id() < b.id(); } 00037 00038 inline bool operator>(const goby::acomms::protobuf::QueueKey& a, 00039 const goby::acomms::protobuf::QueueKey& b) 00040 { return (a.id() == b.id()) ? a.type() > b.type() : a.id() > b.id(); } 00041 inline bool operator>=(const goby::acomms::protobuf::QueueKey& a, 00042 const goby::acomms::protobuf::QueueKey& b) 00043 { return !(a<b); } 00044 inline bool operator<=(const goby::acomms::protobuf::QueueKey& a, 00045 const goby::acomms::protobuf::QueueKey& b) 00046 { return !(a>b); } 00047 inline bool operator==(const goby::acomms::protobuf::QueueKey& a, 00048 const goby::acomms::protobuf::QueueKey& b) 00049 { return (a.id() == b.id()) && (a.type() == b.type()); } 00050 } 00051 } 00052 } 00053 00054 00055 00056 00057 00058 00059 #endif