R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
IAddress Class Referenceabstract

Interface representing a network address (IP + port). More...

#include <IAddress.hpp>

Inheritance diagram for IAddress:
Inheritance graph
Collaboration diagram for IAddress:
Collaboration graph

Public Member Functions

virtual ~IAddress ()=default
 
virtual std::string getHost () const =0
 Get the hostname or IP address as a string.
 
virtual uint16_t getPort () const =0
 Get the port number.
 
virtual void setHost (const std::string &host)=0
 Set the hostname or IP address.
 
virtual void setPort (uint16_t port)=0
 Set the port number.
 

Detailed Description

Interface representing a network address (IP + port).

IAddress abstracts away the underlying network address representation, allowing the backend (ENet, ASIO, etc.) to be swapped without impacting client or server code.

Definition at line 21 of file IAddress.hpp.

Constructor & Destructor Documentation

◆ ~IAddress()

virtual IAddress::~IAddress ( )
virtualdefault

Member Function Documentation

◆ getHost()

virtual std::string IAddress::getHost ( ) const
pure virtual

Get the hostname or IP address as a string.

Returns
The host address.

Implemented in ENetAddressWrapper.

◆ getPort()

virtual uint16_t IAddress::getPort ( ) const
pure virtual

Get the port number.

Returns
The port number.

Implemented in ENetAddressWrapper.

◆ setHost()

virtual void IAddress::setHost ( const std::string &  host)
pure virtual

Set the hostname or IP address.

Parameters
hostThe hostname or IP address string.

Implemented in ENetAddressWrapper.

◆ setPort()

virtual void IAddress::setPort ( uint16_t  port)
pure virtual

Set the port number.

Parameters
portThe port number.

Implemented in ENetAddressWrapper.


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