Jpp
KM3NeT_Acoustic_Link.h
Go to the documentation of this file.
1 #ifndef KM3NET_ACOUSTIC_LINK_H_
2 #define KM3NET_ACOUSTIC_LINK_H_
3 
4 #include <map>
5 
6 #include <boost/asio.hpp>
7 #include <boost/bind.hpp>
8 #include <boost/array.hpp>
9 #include <boost/shared_ptr.hpp>
10 #include <boost/enable_shared_from_this.hpp>
11 
13 #include "Tools/KM3NeT_DOM.h"
14 
15 
16 #define STD_DIM_BUFFER 131072
17 
18 /**
19  * \author fsimeone
20  */
21 
22 //#define DEBUG_KM3NET_ACOUSTIC_LINK
23 
24 
25 class KM3NeT_Acoustic_Link : public boost::enable_shared_from_this<KM3NeT_Acoustic_Link>
26 {
27 
28 
29 public:
30  static const int DEBUG_LEVEL=3;
31 
32  KM3NeT_Acoustic_Link( boost::asio::io_service& io_service,\
34  uint32_t buffer_size=STD_DIM_BUFFER);
35  virtual ~KM3NeT_Acoustic_Link();
36  boost::asio::ip::tcp::socket& Socket(){return socket_;};
37  void Start_reading();
38  void Disconnect(bool Soft=true);
39 
40 private:
41  void Read_completed(const boost::system::error_code& error,std::size_t transferred);
42 
43  boost::asio::io_service::strand strand_;
44  boost::asio::ip::tcp::socket socket_;
45  uint8_t* buffer_;
46  uint32_t buffer_size_;
47  uint32_t data_size_;
49  uint32_t dom_id_;
51 };
52 
53 typedef boost::shared_ptr<KM3NeT_Acoustic_Link> pLink;
54 
55 #endif /* KM3NET_ACOUSTIC_LINK_H_ */
Audio_Structures.h
buffer_size
const static size_t buffer_size
Definition: clb_swiss_knife.cpp:169
std::map< std::size_t, pDOM >
KM3NeT_DOM.h