EchoLib 1.3.5
EchoLinkStationData.h
Go to the documentation of this file.
1
30#ifndef ECHOLINK_STATION_DATA_INCLUDED
31#define ECHOLINK_STATION_DATA_INCLUDED
32
33
34/****************************************************************************
35 *
36 * System Includes
37 *
38 ****************************************************************************/
39
40#include <netinet/in.h>
41
42#include <string>
43
44
45/****************************************************************************
46 *
47 * Project Includes
48 *
49 ****************************************************************************/
50
51#include <AsyncIpAddress.h>
52
53
54/****************************************************************************
55 *
56 * Local Includes
57 *
58 ****************************************************************************/
59
60
61
62/****************************************************************************
63 *
64 * Forward declarations
65 *
66 ****************************************************************************/
67
68
69
70/****************************************************************************
71 *
72 * Namespace
73 *
74 ****************************************************************************/
75
76namespace EchoLink
77{
78
79/****************************************************************************
80 *
81 * Defines & typedefs
82 *
83 ****************************************************************************/
84
85
86
87/****************************************************************************
88 *
89 * Exported Global Variables
90 *
91 ****************************************************************************/
92
93
94
95/****************************************************************************
96 *
97 * Class definitions
98 *
99 ****************************************************************************/
100
109{
110 public:
121
122 static const int MAXCALL = 15;
123 static const int MAXDATA = 45;
124 static const int MAXDESC = 27;
125 static const int MAXID = 7;
126 static const int MAXIP = 20;
127
133 static std::string statusStr(Status status);
134
139
143 StationData(const StationData& rhs) { *this = rhs; }
144
148 void clear(void);
149
154 void setCallsign(const std::string& callsign);
155
160 const std::string& callsign(void) const { return m_callsign; }
161
173 void setData(const char *data);
174
179 void setStatus(Status status) { m_status = status; }
180
185 Status status(void) const { return m_status; }
186
191 std::string statusStr(void) const { return statusStr(m_status); }
192
197 void setTime(const std::string& time) { m_time = time; }
198
203 const std::string& time(void) const { return m_time; }
204
209 void setDescription(const std::string& desc) { m_description = desc; }
210
215 const std::string& description(void) const { return m_description; }
216
221 void setId(int id) { m_id = id; }
222
227 int id(void) const { return m_id; }
228
233 void setIp(const Async::IpAddress& ip) { m_ip = ip; }
234
239 const Async::IpAddress ip(void) const { return m_ip; }
240
245 std::string ipStr(void) const { return m_ip.toString(); }
246
259 std::string code(void) const { return m_code; }
260
267
268 bool operator<(const StationData &rhs) const
269 {
270 return m_callsign < rhs.m_callsign;
271 }
272
278 friend std::ostream& operator<<(std::ostream& os,
279 const StationData& station);
280
281
282 protected:
283
284 private:
285 std::string m_callsign;
286 Status m_status;
287 std::string m_time;
288 std::string m_description;
289 int m_id;
290 Async::IpAddress m_ip;
291 std::string m_code;
292
293 void removeTrailingSpaces(std::string& str);
294 std::string callToCode(const std::string& call);
295
296}; /* class StationData */
297
298
299} /* namespace */
300
301#endif /* ECHOLINK_STATION_DATA_INCLUDED */
302
303
304
305/*
306 * This file has not been truncated
307 */
308
uint8_t data[1024]
Definition EchoLinkQso.h:7