owlps/owlps-positioning/src/outputudpsocket.hh

40 lines
826 B
C++

#ifndef _OWLPS_POSITIONING_OUTPUTUDPSOCKET_HH_
#define _OWLPS_POSITIONING_OUTPUTUDPSOCKET_HH_
#include "outputmedium.hh"
#include <string>
#include <stdint.h> // <cstdint> is not C++ 98 compliant
/// Sends results to an UDP socket
class OutputUDPSocket: public OutputMedium
{
private:
int socketDescriptor ;
std::string remote_host ;
uint_fast16_t remote_port ;
/** @name Operations */
//@{
/// Initialises the socket
void init_socket(void) ;
void kill_socket(void) ;
void send_data(std::string msg) ;
//@}
public:
OutputUDPSocket(const std::string &_remote_ip,
const uint_fast16_t _port) ;
~OutputUDPSocket(void) ;
/** @name Operations */
//@{
/// Initialises the socket
void write(const Result &result) ;
//@}
} ;
#endif // _OWLPS_POSITIONING_OUTPUTUDPSOCKET_HH_