EchoLink::StationData Class Reference

A class for representing data for a station. More...

#include <EchoLinkStationData.h>

List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Static Public Attributes

Friends


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


Member Enumeration Documentation

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.


Constructor & Destructor Documentation

EchoLink::StationData::StationData ( void   ) 

Default constructor.

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

Copy constructor.

Definition at line 143 of file EchoLinkStationData.h.


Member Function Documentation

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

Get the callsign.

Returns:
Returns the callsign

Definition at line 160 of file EchoLinkStationData.h.

void EchoLink::StationData::clear ( void   ) 

Clear the contents and reset to default values.

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

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

Get the description/location string.

Returns:
Returns the description/location string

Definition at line 215 of file EchoLinkStationData.h.

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

Get the EchoLink ID number.

Returns:
Returns the EchoLink ID number

Definition at line 227 of file EchoLinkStationData.h.

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

Get the IP address.

Returns:
Returns the IP address

Definition at line 239 of file EchoLinkStationData.h.

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

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

Assignment operator.

Parameters:
rhs Right Hand Side expression
Returns:
Returns a reference to this object
void EchoLink::StationData::setCallsign ( const std::string &  callsign  ) 

Set the callsign.

Parameters:
callsign The callsign to set
void EchoLink::StationData::setData ( const char *  data  ) 

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

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

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

Set the description/location string.

Parameters:
desc The description string to set

Definition at line 209 of file EchoLinkStationData.h.

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

Set the EchoLink ID number.

Parameters:
id The new id

Definition at line 221 of file EchoLinkStationData.h.

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

Set the IP address.

Parameters:
ip The IP address to set

Definition at line 233 of file EchoLinkStationData.h.

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

Set the status.

Parameters:
status The new status to set

Definition at line 179 of file EchoLinkStationData.h.

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

Set the time.

Parameters:
time The time to set

Definition at line 197 of file EchoLinkStationData.h.

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

Get the status.

Returns:
Returns the status

Definition at line 185 of file EchoLinkStationData.h.

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

References statusStr().

Referenced by statusStr().

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

Translate a status code to a string.

Parameters:
status The status code to translate
Returns:
Returns the string representation of the given status code
const std::string& EchoLink::StationData::time ( void   )  const [inline]

Get the time.

Returns:
Returns the time

Definition at line 203 of file EchoLinkStationData.h.


Friends And Related Function Documentation

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

Output stream operator.

Parameters:
os The stream to output data to
station The station data to output to the stream

Member Data Documentation

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

The maximum length of a callsign.

Definition at line 122 of file EchoLinkStationData.h.

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

The maximum length of the data field.

Definition at line 123 of file EchoLinkStationData.h.

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

The maximum length of a description.

Definition at line 124 of file EchoLinkStationData.h.

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

The maximum length of the id field.

Definition at line 125 of file EchoLinkStationData.h.

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

The maximum length of the ip address.

Definition at line 126 of file EchoLinkStationData.h.


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208