R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
IAddress.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** Created by IamSwan on 06/12/2025.
4** File description:
5** IAddress.hpp
6*/
7
8#pragma once
9
10#include <cstdint>
11#include <string>
12
21class IAddress {
22 public:
23 virtual ~IAddress() = default;
24
29 [[nodiscard]] virtual std::string getHost() const = 0;
30
35 [[nodiscard]] virtual uint16_t getPort() const = 0;
36
41 virtual void setHost(const std::string &host) = 0;
42
47 virtual void setPort(uint16_t port) = 0;
48};
Interface representing a network address (IP + port).
Definition IAddress.hpp:21
virtual void setPort(uint16_t port)=0
Set the port number.
virtual ~IAddress()=default
virtual void setHost(const std::string &host)=0
Set the hostname or IP address.
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.