30#ifndef ECHOLINK_STATION_DATA_INCLUDED
31#define ECHOLINK_STATION_DATA_INCLUDED
40#include <netinet/in.h>
51#include <AsyncIpAddress.h>
160 const std::string&
callsign(
void)
const {
return m_callsign; }
203 const std::string&
time(
void)
const {
return m_time; }
215 const std::string&
description(
void)
const {
return m_description; }
227 int id(
void)
const {
return m_id; }
239 const Async::IpAddress
ip(
void)
const {
return m_ip; }
245 std::string
ipStr(
void)
const {
return m_ip.toString(); }
259 std::string
code(
void)
const {
return m_code; }
270 return m_callsign < rhs.m_callsign;
285 std::string m_callsign;
288 std::string m_description;
290 Async::IpAddress m_ip;
293 void removeTrailingSpaces(std::string& str);
294 std::string callToCode(
const std::string& call);
A class for representing data for a station.
void setIp(const Async::IpAddress &ip)
Set the IP address.
static const int MAXIP
The maximum length of the ip address.
@ STAT_ONLINE
The state is online.
@ STAT_BUSY
The state is busy.
@ STAT_OFFLINE
The state is offline.
@ STAT_UNKNOWN
The state is unknown.
static const int MAXDESC
The maximum length of a description.
void setCallsign(const std::string &callsign)
Set the callsign.
StationData & operator=(const StationData &rhs)
Assignment operator.
bool operator<(const StationData &rhs) const
void setDescription(const std::string &desc)
Set the description/location string.
void setId(int id)
Set the EchoLink ID number.
const Async::IpAddress ip(void) const
Get the IP address.
const std::string & time(void) const
Get the time.
StationData(const StationData &rhs)
Copy constructor.
StationData(void)
Default constructor.
const std::string & callsign(void) const
Get the callsign.
static std::string statusStr(Status status)
Translate a status code to a string.
static const int MAXID
The maximum length of the id field.
void setTime(const std::string &time)
Set the time.
void clear(void)
Clear the contents and reset to default values.
static const int MAXDATA
The maximum length of the data field.
void setStatus(Status status)
Set the status.
static const int MAXCALL
The maximum length of a callsign.
friend std::ostream & operator<<(std::ostream &os, const StationData &station)
Output stream operator.
void setData(const char *data)
Set station data from a string as represented in the directory server.
std::string statusStr(void) const
Return the string representation of the status.
std::string ipStr(void) const
Get the string representation of the IP address.
Status status(void) const
Get the status.
const std::string & description(void) const
Get the description/location string.
int id(void) const
Get the EchoLink ID number.
std::string code(void) const
Get the code representation of the callsign.
Namespace to encapsulate EchoLink communication classes.