Yate
Public Member Functions | List of all members
MGCPEndpointId Class Reference

An endpoint id. More...

#include <yatemgcp.h>

Inheritance diagram for MGCPEndpointId:
MGCPEndpoint MGCPEpInfo

Public Member Functions

 MGCPEndpointId ()
 
 MGCPEndpointId (const String &src)
 
 MGCPEndpointId (const MGCPEndpointId &value)
 
 MGCPEndpointId (const char *endpoint, const char *host, int port, bool addPort=true)
 
const Stringid () const
 
const Stringuser () const
 
const Stringhost () const
 
int port () const
 
void port (int newPort, bool addPort=true)
 
void set (const char *endpoint, const char *host, int port, bool addPort=true)
 
void set (const String &src)
 
bool valid () const
 

Detailed Description

An endpoint id.

This class holds an endpoint id in the form "endpoint@host:port"

Constructor & Destructor Documentation

◆ MGCPEndpointId() [1/4]

MGCPEndpointId ( )
inline

Constructor

◆ MGCPEndpointId() [2/4]

MGCPEndpointId ( const String src)
inline

Constructor. Construct this endpoint id from a string

Parameters
srcThe string to construct from

◆ MGCPEndpointId() [3/4]

MGCPEndpointId ( const MGCPEndpointId value)
inline

Copy constructor

Parameters
valueOriginal Endpoint ID to copy

◆ MGCPEndpointId() [4/4]

MGCPEndpointId ( const char *  endpoint,
const char *  host,
int  port,
bool  addPort = true 
)
inline

Constructor. Construct this endpoint id

Parameters
endpointThe user part of the endpoint's URI
hostThe IP address of the endpoint's URI
portThe port used by the endpoint to receive data
addPortAdd :port at end of id only if port is not zero

Member Function Documentation

◆ host()

const String & host ( ) const
inline

Get the host part of the endpoint URI

Returns
The host part of the endpoint URI

◆ id()

const String & id ( ) const
inline

Get the full id of the endpoint

Returns
The full id of the endpoint

Referenced by MGCPEndpoint::toString().

◆ port() [1/2]

int port ( ) const
inline

Get the port used by this endpoint

Returns
The port used by this endpoint

Referenced by MGCPEpInfo::MGCPEpInfo().

◆ port() [2/2]

void port ( int  newPort,
bool  addPort = true 
)
inline

Set the port used by this endpoint

Parameters
newPortThe new port used by this endpoint
addPortAdd :port at end of id only if port is not zero

◆ set() [1/2]

void set ( const char *  endpoint,
const char *  host,
int  port,
bool  addPort = true 
)

Set this endpoint id. Convert it to lower case

Parameters
endpointThe user part of the endpoint's URI
hostThe IP address of the endpoint's URI
portThe port used by the endpoint to receive data
addPortAdd :port at end of id only if port is not zero

◆ set() [2/2]

void set ( const String src)
inline

Set this endpoint id. Convert it to lower case

Parameters
srcThe string to construct from

References URI::getHost(), URI::getPort(), and URI::getUser().

◆ user()

const String & user ( ) const
inline

Get the user part of the endpoint URI

Returns
The user part of the endpoint URI

◆ valid()

bool valid ( ) const
inline

Check if this is a valid endpoint id as defined in RFC 3435 3.2.1.3. It is considerred valid if the user and host part lengths are between 1 and 255 and the port is not 0

Returns
True if this is a valid endpoint id

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