EchoLib
1.3.3
|
A class for representing data for a station. More...
#include <EchoLinkStationData.h>
Public Types | |
enum | Status { STAT_UNKNOWN, STAT_OFFLINE, STAT_ONLINE, STAT_BUSY } |
Public Member Functions | |
StationData (void) | |
Default constructor. More... | |
StationData (const StationData &rhs) | |
Copy constructor. More... | |
void | clear (void) |
Clear the contents and reset to default values. More... | |
void | setCallsign (const std::string &callsign) |
Set the callsign. More... | |
const std::string & | callsign (void) const |
Get the callsign. More... | |
void | setData (const char *data) |
Set station data from a string as represented in the directory server. More... | |
void | setStatus (Status status) |
Set the status. More... | |
Status | status (void) const |
Get the status. More... | |
std::string | statusStr (void) const |
Return the string representation of the status. More... | |
void | setTime (const std::string &time) |
Set the time. More... | |
const std::string & | time (void) const |
Get the time. More... | |
void | setDescription (const std::string &desc) |
Set the description/location string. More... | |
const std::string & | description (void) const |
Get the description/location string. More... | |
void | setId (int id) |
Set the EchoLink ID number. More... | |
int | id (void) const |
Get the EchoLink ID number. More... | |
void | setIp (const Async::IpAddress &ip) |
Set the IP address. More... | |
const Async::IpAddress | ip (void) const |
Get the IP address. More... | |
std::string | ipStr (void) const |
Get the string representation of the IP address. More... | |
std::string | code (void) const |
Get the code representation of the callsign. More... | |
StationData & | operator= (const StationData &rhs) |
Assignment operator. More... | |
bool | operator< (const StationData &rhs) const |
Static Public Member Functions | |
static std::string | statusStr (Status status) |
Translate a status code to a string. More... | |
Static Public Attributes | |
static const int | MAXCALL = 15 |
The maximum length of a callsign. More... | |
static const int | MAXDATA = 45 |
The maximum length of the data field. More... | |
static const int | MAXDESC = 27 |
The maximum length of a description. More... | |
static const int | MAXID = 7 |
The maximum length of the id field. More... | |
static const int | MAXIP = 20 |
The maximum length of the ip address. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const StationData &station) |
Output stream operator. More... | |
A class for representing data for a station.
This class is used to represent data about a station.
Definition at line 108 of file EchoLinkStationData.h.
The status of the station in the directory server
Enumerator | |
---|---|
STAT_UNKNOWN |
The state is unknown. |
STAT_OFFLINE |
The state is offline. |
STAT_ONLINE |
The state is online. |
STAT_BUSY |
The state is busy. |
Definition at line 114 of file EchoLinkStationData.h.
EchoLink::StationData::StationData | ( | void | ) |
Default constructor.
|
inline |
Copy constructor.
Definition at line 143 of file EchoLinkStationData.h.
References callsign(), clear(), and setCallsign().
|
inline |
Get the callsign.
Definition at line 160 of file EchoLinkStationData.h.
References data, and setData().
Referenced by StationData().
void EchoLink::StationData::clear | ( | void | ) |
Clear the contents and reset to default values.
Referenced by StationData().
|
inline |
Get the code representation of the callsign.
The code representation is the callsign mapped to digits only. The mapping is done using the "phone method". ABC=2, DEF=3, GHI=4, JKL=5, MNO=6, PQRS=7, TUV=8, WXYZ=9. Digits are mapped to its corresponding digit. Star is ignored. All other characters are mapped to digit 1.
Definition at line 259 of file EchoLinkStationData.h.
References operator=().
|
inline |
Get the description/location string.
Definition at line 215 of file EchoLinkStationData.h.
|
inline |
Get the EchoLink ID number.
Definition at line 227 of file EchoLinkStationData.h.
Referenced by setId().
|
inline |
Get the IP address.
Definition at line 239 of file EchoLinkStationData.h.
Referenced by setIp().
|
inline |
Get the string representation of the IP address.
Definition at line 245 of file EchoLinkStationData.h.
|
inline |
Definition at line 268 of file EchoLinkStationData.h.
References operator<<.
StationData& EchoLink::StationData::operator= | ( | const StationData & | rhs | ) |
Assignment operator.
rhs | Right Hand Side expression |
Referenced by code().
void EchoLink::StationData::setCallsign | ( | const std::string & | callsign | ) |
void EchoLink::StationData::setData | ( | const char * | data | ) |
Set station data from a string as represented in the directory server.
data | The data to set |
This function is used to set status, time and description from a string that have a representation like in the reply from the directory server. The only use for this function is probably when parsing a reply from the directory server. Use setStatus, setTime and setDescription for normal use.
Referenced by callsign().
|
inline |
Set the description/location string.
desc | The description string to set |
Definition at line 209 of file EchoLinkStationData.h.
|
inline |
Set the EchoLink ID number.
id | The new id |
Definition at line 221 of file EchoLinkStationData.h.
References id().
|
inline |
Set the IP address.
ip | The IP address to set |
Definition at line 233 of file EchoLinkStationData.h.
References ip().
|
inline |
Set the status.
status | The new status to set |
Definition at line 179 of file EchoLinkStationData.h.
References status().
|
inline |
Set the time.
time | The time to set |
Definition at line 197 of file EchoLinkStationData.h.
References time().
|
inline |
Get the status.
Definition at line 185 of file EchoLinkStationData.h.
Referenced by setStatus().
|
static |
Translate a status code to a string.
status | The status code to translate |
|
inline |
Return the string representation of the status.
Definition at line 191 of file EchoLinkStationData.h.
References statusStr().
Referenced by statusStr(), and EchoLink::Directory::statusStr().
|
inline |
Get the time.
Definition at line 203 of file EchoLinkStationData.h.
Referenced by setTime().
|
friend |
Output stream operator.
os | The stream to output data to |
station | The station data to output to the stream |
Referenced by operator<().
|
static |
The maximum length of a callsign.
Definition at line 122 of file EchoLinkStationData.h.
|
static |
The maximum length of the data field.
Definition at line 123 of file EchoLinkStationData.h.
|
static |
The maximum length of a description.
Definition at line 124 of file EchoLinkStationData.h.
|
static |
The maximum length of the id field.
Definition at line 125 of file EchoLinkStationData.h.
|
static |
The maximum length of the ip address.
Definition at line 126 of file EchoLinkStationData.h.