owlps/owlps-positioning/src/outputudpsocket.hh

41 lines
868 B
C++
Raw Normal View History

#ifndef _OWLPS_POSITIONING_OUTPUTUDPSOCKET_HH_
#define _OWLPS_POSITIONING_OUTPUTUDPSOCKET_HH_
2011-03-15 15:27:42 +01:00
#include "outputmedium.hh"
2011-03-15 15:27:42 +01:00
#include <string>
#include <stdint.h> // <cstdint> is not C++ 98 compliant
2011-03-15 15:27:42 +01:00
/// Sends results to an UDP socket
class OutputUDPSocket: public OutputMedium
2011-03-15 15:27:42 +01:00
{
private:
int socketDescriptor ;
std::string remote_host ;
uint_fast16_t remote_port ;
2011-03-15 15:27:42 +01: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:
OutputUDPSocket(const std::string &_remote_ip,
const uint_fast16_t _port) ;
~OutputUDPSocket(void) ;
2011-03-15 15:27:42 +01:00
/** @name Operations */
//@{
/// Initialises the socket
2011-03-15 15:27:42 +01:00
void write(const Result &result) ;
void write(const ResultList &results) ;
//@}
2011-03-15 15:27:42 +01:00
} ;
#endif // _OWLPS_POSITIONING_OUTPUTUDPSOCKET_HH_