AuroraRuntime/Source/IO/Net/AuNetInterface.hpp
Jamie Reece Wilson 2717178681 [+] Added INetworkInterface overloads
[+] INetInterface::SetWorkersService
[+] INetInterface::SetResolveService
[+] INetInterface::SetDatagramService
[+] INetInterface::SetInterfacesService
[*] Refactor: INetAdapter::GetStatus -> INetAdapter::GetAdapterStatus
[*] Refactor: const NetError &ISocketBase::GetError() -> AuOptional<const NetError &> ISocketBase::GetError()
[*] Refactor: INetAdapter to return const references of IPAddresses
2024-04-01 06:28:35 +01:00

58 lines
2.1 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuNetInterface.hpp
Date: 2022-8-16
Author: Reece
***/
#pragma once
#include "AuNetSrvWorkers.hpp"
#include "AuNetSrvSockets.hpp"
#include "AuNetSrvResolve.hpp"
#include "AuNetSrvDatagram.hpp"
#include "AuNetSrvInterfaces.hpp"
namespace Aurora::IO::Net
{
struct NetInterface : INetInterface,
AuEnableSharedFromThis<NetInterface>
{
NetInterface();
AuSPtr<INetSrvWorkers> GetWorkersService() override;
void SetWorkersService(const AuSPtr<INetSrvWorkers> &pWorkers) override;
AuSPtr<INetSrvResolve> GetResolveService() override;
void SetResolveService(const AuSPtr<INetSrvResolve> &pResolve) override;
AuSPtr<INetSrvSockets> GetSocketService() override;
void SetSocketService(const AuSPtr<INetSrvSockets> &pSockets) override;
AuSPtr<INetSrvDatagram> GetDatagramService() override;
void SetDatagramService(const AuSPtr<INetSrvDatagram> &pSockets) override;
AuSPtr<INetSrvInterfaces> GetInterfacesService() override;
void SetInterfacesService(const AuSPtr<INetSrvInterfaces> &pNetworkInterfaces) override;
bool TrySchedule(const AuSPtr<IIOProcessorWorkUnit> &pWorkUnit) override;
AuSPtr<NetWorker> TryScheduleEx();
void Shutdown() override;
void Destroy() override;
private:
NetSrvWorkers netServiceWorkers_; // Soviet Union Anthem
NetSrvSockets netServiceSockets_;
NetSrvResolve netServiceResolve_;
NetSrvDatagram netServiceDatagram_;
NetSrvInterfaces netServiceInterfaces_;
AuSPtr<INetSrvWorkers> pNetServiceOverloadWorkers_;
AuSPtr<INetSrvResolve> pNetServiceOverloadResolve_;
AuSPtr<INetSrvSockets> pNetServiceOverloadSockets_;
AuSPtr<INetSrvDatagram> pNetServiceOverloadDatagram_;
AuSPtr<INetSrvInterfaces> pNetServiceOverloadNetworkInterfaces_;
AuUInt atomicCounter_ {};
AuMutex mutex_;
};
}