Files
NazaraEngine/include/Nazara/Network/SocketPoller.hpp
Jérôme Leclercq 03e2801dbe Split engine to packages NazaraUtils and NZSL (#375)
* Move code to NazaraUtils and NZSL packages

* Reorder includes

* Tests: Remove glslang and spirv-tools deps

* Tests: Remove glslang init

* Remove NazaraUtils tests and fix Vector4Test

* Fix Linux compilation

* Update msys2-build.yml

* Fix assimp package

* Update xmake.lua

* Update xmake.lua

* Fix shader compilation on MinGW

* Final fixes

* The final fix 2: the fix strikes back!

* Disable cache on CI

* The return of the fix™️
2022-05-25 19:36:10 +02:00

48 lines
1.3 KiB
C++

// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Network module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_NETWORK_SOCKETPOLLER_HPP
#define NAZARA_NETWORK_SOCKETPOLLER_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Network/AbstractSocket.hpp>
#include <Nazara/Utils/MovablePtr.hpp>
namespace Nz
{
class SocketPollerImpl;
class NAZARA_NETWORK_API SocketPoller
{
public:
SocketPoller();
SocketPoller(const SocketPoller&) = delete;
SocketPoller(SocketPoller&&) noexcept = default;
~SocketPoller();
void Clear();
bool IsReadyToRead(const AbstractSocket& socket) const;
bool IsReadyToWrite(const AbstractSocket& socket) const;
bool IsRegistered(const AbstractSocket& socket) const;
bool RegisterSocket(AbstractSocket& socket, SocketPollEventFlags eventFlags);
void UnregisterSocket(AbstractSocket& socket);
unsigned int Wait(int msTimeout, SocketError* error = nullptr);
SocketPoller& operator=(const SocketPoller&) = delete;
SocketPoller& operator=(SocketPoller&&) noexcept = default;
private:
MovablePtr<SocketPollerImpl> m_impl;
};
}
#include <Nazara/Network/SocketPoller.inl>
#endif // NAZARA_NETWORK_SOCKETPOLLER_HPP