Goby Underwater Autonomy Project
Series: 1.1, revision: 163, released on 2013-02-06 14:23:27 -0500
|
00001 // copyright 2008, 2009 t. schneider tes@mit.edu 00002 // 00003 // this file is part of the Dynamic Compact Control Language (DCCL), 00004 // the goby-acomms codec. goby-acomms is a collection of libraries 00005 // for acoustic underwater networking 00006 // 00007 // This program is free software: you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // This software is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with this software. If not, see <http://www.gnu.org/licenses/>. 00019 00020 #ifndef MESSAGE_VAR_INT20100317H 00021 #define MESSAGE_VAR_INT20100317H 00022 00023 #include "message_var_float.h" 00024 namespace goby 00025 { 00026 namespace acomms 00027 { 00028 // <int> is a <float> with <precision>0</precision> 00029 class DCCLMessageVarInt : public DCCLMessageVarFloat 00030 { 00031 public: 00032 DCCLMessageVarInt(long max = std::numeric_limits<long>::max(), long min = 0) 00033 : DCCLMessageVarFloat(max, min) 00034 { } 00035 00036 virtual DCCLType type() const { return dccl_int; } 00037 00038 private: 00039 DCCLMessageVal cast(double d, int precision) { return long(d); } 00040 00041 }; 00042 } 00043 } 00044 #endif