2011-04-04 17:37:19 +02:00
|
|
|
#ifndef _OWLPS_POSITIONING_OUTPUTUDPSOCKET_HH_
|
|
|
|
#define _OWLPS_POSITIONING_OUTPUTUDPSOCKET_HH_
|
2011-04-04 16:45:00 +02:00
|
|
|
|
2011-03-15 15:27:42 +01:00
|
|
|
#include "outputmedium.hh"
|
2011-04-04 16:45:00 +02:00
|
|
|
|
2011-03-15 15:27:42 +01:00
|
|
|
#include <string>
|
2011-04-05 11:22:28 +02:00
|
|
|
#include <stdint.h> // <cstdint> is not C++ 98 compliant
|
2011-03-15 15:27:42 +01:00
|
|
|
|
2011-04-04 16:45:00 +02:00
|
|
|
/// Sends results to an UDP socket
|
2011-04-04 17:37:19 +02:00
|
|
|
class OutputUDPSocket: public OutputMedium
|
2011-03-15 15:27:42 +01:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
int socketDescriptor ;
|
2011-04-05 11:22:28 +02:00
|
|
|
std::string remote_host ;
|
|
|
|
uint_fast16_t remote_port ;
|
2011-03-15 15:27:42 +01:00
|
|
|
|
2011-04-04 16:45:00 +02:00
|
|
|
/** @name Operations */
|
|
|
|
//@{
|
|
|
|
/// Initialises the socket
|
|
|
|
void init_socket(void) ;
|
|
|
|
void kill_socket(void) ;
|
|
|
|
void send_data(std::string msg) ;
|
|
|
|
//@}
|
|
|
|
|
2011-03-15 15:27:42 +01:00
|
|
|
public:
|
2011-04-05 11:22:28 +02:00
|
|
|
OutputUDPSocket(const std::string &_remote_ip,
|
|
|
|
const uint_fast16_t _port) ;
|
2011-04-04 17:37:19 +02:00
|
|
|
~OutputUDPSocket(void) ;
|
2011-03-15 15:27:42 +01:00
|
|
|
|
2011-04-04 16:45:00 +02:00
|
|
|
/** @name Operations */
|
|
|
|
//@{
|
|
|
|
/// Initialises the socket
|
2011-03-15 15:27:42 +01:00
|
|
|
void write(const Result &result) ;
|
2011-04-05 12:05:46 +02:00
|
|
|
void write(const ResultList &results) ;
|
2011-04-04 16:45:00 +02:00
|
|
|
//@}
|
2011-03-15 15:27:42 +01:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-04 17:37:19 +02:00
|
|
|
#endif // _OWLPS_POSITIONING_OUTPUTUDPSOCKET_HH_
|