<commit_before>// Copyright (C) 2015 <NAME>
// 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_SOCKETPOLLERIMPL_HPP
#define NAZARA_SOCKETPOLLERIMPL_HPP

#include <Nazara/Network/IpAddress.hpp>
#include <Nazara/Network/SocketHandle.hpp>
#include <Nazara/Network/Win32/SocketImpl.hpp>
#include <unordered_map>
#include <unordered_set>
#include <vector>

namespace Nz
{
	class SocketPollerImpl
	{
		public:
			SocketPollerImpl() = default;
			~SocketPollerImpl() = default;

			void Clear();

			bool IsReady(SocketHandle socket) const;
			bool IsRegistered(SocketHandle socket) const;

			bool RegisterSocket(SocketHandle socket);
			void UnregisterSocket(SocketHandle socket);

			int Wait(UInt64 msTimeout, SocketError* error);

		private:
			std::unordered_set<SocketHandle> m_activeSockets;
			std::unordered_map<SocketHandle, std::size_t> m_allSockets;
			std::vector<PollSocket> m_sockets;
	};
}

#endif // NAZARA_SOCKETPOLLERIMPL_HPP<commit_msg>Network/SocketPollerImpl: Fix compilation on POSIX<commit_after>// Copyright (C) 2015 <NAME>
// 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_SOCKETPOLLERIMPL_HPP
#define NAZARA_SOCKETPOLLERIMPL_HPP

#include <Nazara/Network/IpAddress.hpp>
#include <Nazara/Network/SocketHandle.hpp>
#include <Nazara/Network/Posix/SocketImpl.hpp>
#include <unordered_map>
#include <unordered_set>
#include <vector>

namespace Nz
{
	class SocketPollerImpl
	{
		public:
			SocketPollerImpl() = default;
			~SocketPollerImpl() = default;

			void Clear();

			bool IsReady(SocketHandle socket) const;
			bool IsRegistered(SocketHandle socket) const;

			bool RegisterSocket(SocketHandle socket);
			void UnregisterSocket(SocketHandle socket);

			int Wait(UInt64 msTimeout, SocketError* error);

		private:
			std::unordered_set<SocketHandle> m_activeSockets;
			std::unordered_map<SocketHandle, std::size_t> m_allSockets;
			std::vector<PollSocket> m_sockets;
	};
}

#endif // NAZARA_SOCKETPOLLERIMPL_HPP

{'fraction_non_alphanumeric': 0.0984360625574977, 'fraction_numerical': 0.006439742410303588, 'mean_word_length': 5.531531531531532, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '665964', 'n_tokens_mistral': 812, 'n_tokens_neox': 722, 'n_words': 171}