EchoLib  1.3.3
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
EchoLink::StationData Class Reference

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...
 
StationDataoperator= (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...
 

Detailed Description

A class for representing data for a station.

Author
Tobias Blomberg
Date
2003-04-13

This class is used to represent data about a station.

Examples
EchoLinkDirectory_demo.cpp.

Definition at line 128 of file EchoLinkStationData.h.

Member Enumeration Documentation

◆ Status

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 166 of file EchoLinkStationData.h.

Constructor & Destructor Documentation

◆ StationData() [1/2]

EchoLink::StationData::StationData ( void  )

Default constructor.

◆ StationData() [2/2]

EchoLink::StationData::StationData ( const StationData rhs)
inline

Copy constructor.

Definition at line 195 of file EchoLinkStationData.h.

Member Function Documentation

◆ callsign()

const std::string& EchoLink::StationData::callsign ( void  ) const
inline

Get the callsign.

Returns
Returns the callsign

Definition at line 212 of file EchoLinkStationData.h.

◆ clear()

void EchoLink::StationData::clear ( void  )

Clear the contents and reset to default values.

◆ code()

std::string EchoLink::StationData::code ( void  ) const
inline

Get the code representation of the callsign.

Returns
Returns 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 311 of file EchoLinkStationData.h.

◆ description()

const std::string& EchoLink::StationData::description ( void  ) const
inline

Get the description/location string.

Returns
Returns the description/location string

Definition at line 267 of file EchoLinkStationData.h.

◆ id()

int EchoLink::StationData::id ( void  ) const
inline

Get the EchoLink ID number.

Returns
Returns the EchoLink ID number

Definition at line 279 of file EchoLinkStationData.h.

◆ ip()

const Async::IpAddress EchoLink::StationData::ip ( void  ) const
inline

Get the IP address.

Returns
Returns the IP address

Definition at line 291 of file EchoLinkStationData.h.

◆ ipStr()

std::string EchoLink::StationData::ipStr ( void  ) const
inline

Get the string representation of the IP address.

Returns
Returns the string representation of the IP address

Definition at line 297 of file EchoLinkStationData.h.

◆ operator<()

bool EchoLink::StationData::operator< ( const StationData rhs) const
inline

Definition at line 320 of file EchoLinkStationData.h.

◆ operator=()

StationData& EchoLink::StationData::operator= ( const StationData rhs)

Assignment operator.

Parameters
rhsRight Hand Side expression
Returns
Returns a reference to this object

◆ setCallsign()

void EchoLink::StationData::setCallsign ( const std::string &  callsign)

Set the callsign.

Parameters
callsignThe callsign to set

◆ setData()

void EchoLink::StationData::setData ( const char *  data)

Set station data from a string as represented in the directory server.

Parameters
dataThe 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.

◆ setDescription()

void EchoLink::StationData::setDescription ( const std::string &  desc)
inline

Set the description/location string.

Parameters
descThe description string to set

Definition at line 261 of file EchoLinkStationData.h.

◆ setId()

void EchoLink::StationData::setId ( int  id)
inline

Set the EchoLink ID number.

Parameters
idThe new id

Definition at line 273 of file EchoLinkStationData.h.

◆ setIp()

void EchoLink::StationData::setIp ( const Async::IpAddress &  ip)
inline

Set the IP address.

Parameters
ipThe IP address to set

Definition at line 285 of file EchoLinkStationData.h.

◆ setStatus()

void EchoLink::StationData::setStatus ( Status  status)
inline

Set the status.

Parameters
statusThe new status to set

Definition at line 231 of file EchoLinkStationData.h.

◆ setTime()

void EchoLink::StationData::setTime ( const std::string &  time)
inline

Set the time.

Parameters
timeThe time to set

Definition at line 249 of file EchoLinkStationData.h.

◆ status()

Status EchoLink::StationData::status ( void  ) const
inline

Get the status.

Returns
Returns the status

Definition at line 237 of file EchoLinkStationData.h.

◆ statusStr() [1/2]

static std::string EchoLink::StationData::statusStr ( Status  status)
static

Translate a status code to a string.

Parameters
statusThe status code to translate
Returns
Returns the string representation of the given status code

◆ statusStr() [2/2]

std::string EchoLink::StationData::statusStr ( void  ) const
inline

Return the string representation of the status.

Returns
Returns a string representation of the status

Definition at line 243 of file EchoLinkStationData.h.

◆ time()

const std::string& EchoLink::StationData::time ( void  ) const
inline

Get the time.

Returns
Returns the time

Definition at line 255 of file EchoLinkStationData.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const StationData station 
)
friend

Output stream operator.

Parameters
osThe stream to output data to
stationThe station data to output to the stream

Member Data Documentation

◆ MAXCALL

const int EchoLink::StationData::MAXCALL = 15
static

The maximum length of a callsign.

Definition at line 174 of file EchoLinkStationData.h.

◆ MAXDATA

const int EchoLink::StationData::MAXDATA = 45
static

The maximum length of the data field.

Definition at line 175 of file EchoLinkStationData.h.

◆ MAXDESC

const int EchoLink::StationData::MAXDESC = 27
static

The maximum length of a description.

Definition at line 176 of file EchoLinkStationData.h.

◆ MAXID

const int EchoLink::StationData::MAXID = 7
static

The maximum length of the id field.

Definition at line 177 of file EchoLinkStationData.h.

◆ MAXIP

const int EchoLink::StationData::MAXIP = 20
static

The maximum length of the ip address.

Definition at line 178 of file EchoLinkStationData.h.


The documentation for this class was generated from the following file: