Goby Underwater Autonomy Project
Series: 1.1, revision: 163, released on 2013-02-06 14:23:27 -0500
|
00001 // t. schneider tes@mit.edu 12.22.08 00002 // ocean engineering graudate student - mit / whoi joint program 00003 // massachusetts institute of technology (mit) 00004 // laboratory for autonomous marine sensing systems (lamss) 00005 // 00006 // this is modem_id_convert.h 00007 // 00008 // 00009 // This program is free software: you can redistribute it and/or modify 00010 // it under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation, either version 3 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // This software is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with this software. If not, see <http://www.gnu.org/licenses/>. 00021 #ifndef MODEM_ID_CONVERTH 00022 #define MODEM_ID_CONVERTH 00023 00024 #include <iostream> 00025 #include <fstream> 00026 #include <sstream> 00027 #include <map> 00028 00029 namespace tes 00030 { 00031 class ModemIdConvert 00032 { 00033 public: 00034 ModemIdConvert() : max_name_length_(0), 00035 max_id_(0) 00036 {} 00037 00038 std::string read_lookup_file(std::string path); 00039 00040 std::string get_name_from_id(int id); 00041 std::string get_type_from_id(int id); 00042 std::string get_location_from_id(int id); 00043 int get_id_from_name(std::string name); 00044 00045 size_t max_name_length() {return max_name_length_;} 00046 int max_id() {return max_id_;} 00047 00048 00049 private: 00050 std::map<int, std::string> names; 00051 std::map<int, std::string> types; 00052 std::map<int, std::string> locations; 00053 00054 size_t max_name_length_; 00055 int max_id_; 00056 }; 00057 } 00058 00059 #endif