Goby Underwater Autonomy Project
Series: 1.1, revision: 163, released on 2013-02-06 14:23:27 -0500
|
00001 // copyright 2009 t. schneider tes@mit.edu 00002 // 00003 // this file is part of goby-acomms, which 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 00019 // gives functions for binding the goby-acomms libraries together 00020 00021 #ifndef BIND20100120H 00022 #define BIND20100120H 00023 00024 #include <boost/bind.hpp> 00025 00026 #include "goby/acomms/connect.h" 00027 #include "goby/acomms/dccl.h" 00028 #include "goby/acomms/queue.h" 00029 #include "goby/acomms/modem_driver.h" 00030 #include "goby/acomms/amac.h" 00031 #include "goby/util/logger.h" 00032 00033 namespace goby 00034 { 00035 namespace acomms 00036 { 00037 00039 inline void bind(ModemDriverBase& driver, QueueManager& queue_manager) 00040 { 00041 connect(&driver.signal_receive, 00042 &queue_manager, &QueueManager::handle_modem_receive); 00043 00044 connect(&driver.signal_data_request, 00045 &queue_manager, &QueueManager::handle_modem_data_request); 00046 00047 connect(&driver.signal_ack, 00048 &queue_manager, &QueueManager::handle_modem_ack); 00049 } 00050 00053 inline void bind(MACManager& mac, ModemDriverBase& driver) 00054 { 00055 connect(&mac.signal_initiate_transmission, 00056 &driver, &ModemDriverBase::handle_initiate_transmission); 00057 00058 connect(&mac.signal_initiate_ranging, 00059 &driver, &ModemDriverBase::handle_initiate_ranging); 00060 00061 connect(&driver.signal_all_incoming, 00062 &mac, &MACManager::handle_modem_all_incoming); 00063 } 00064 00065 00067 inline void bind(ModemDriverBase& driver, QueueManager& queue_manager, MACManager& mac) 00068 { 00069 bind(driver, queue_manager); 00070 bind(mac, driver); 00071 } 00072 00073 // examples 00078 00079 } 00080 00081 } 00082 00083 #endif