Merge remote-tracking branch 'refs/remotes/origin/master' into enet_wip_nothing_to_see_here
This commit is contained in:
@@ -29,7 +29,7 @@ namespace Nz
|
||||
public:
|
||||
using BitField = typename std::conditional<(EnumAsFlags<E>::max > 32), UInt64, UInt32>::type;
|
||||
|
||||
constexpr Flags(BitField value);
|
||||
constexpr Flags(BitField value = 0);
|
||||
constexpr Flags(E enumVal);
|
||||
|
||||
explicit constexpr operator bool() const;
|
||||
|
||||
@@ -13,13 +13,13 @@ namespace Nz
|
||||
* \brief Core class used to combine enumeration values into flags bitfield
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Constructs a Flags object using a bitfield
|
||||
*
|
||||
* \param value Bitfield to be used
|
||||
/*!
|
||||
* \brief Constructs a Flags object using a bitfield
|
||||
*
|
||||
* \param value Bitfield to be used
|
||||
*
|
||||
* Uses a bitfield to builds the flag value. (e.g. if bit 0 is active, then Enum value 0 will be set as active).
|
||||
*/
|
||||
*/
|
||||
template<typename E>
|
||||
constexpr Flags<E>::Flags(BitField value) :
|
||||
m_value(value)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2017 Jérôme Leclercq
|
||||
// Copyright (C) 2017 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Network module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
@@ -68,4 +68,4 @@ namespace Nz
|
||||
|
||||
#include <Nazara/Network/AbstractSocket.inl>
|
||||
|
||||
#endif // NAZARA_ABSTRACTSOCKET_HPP
|
||||
#endif // NAZARA_ABSTRACTSOCKET_HPP
|
||||
|
||||
21
include/Nazara/Network/NetBuffer.hpp
Normal file
21
include/Nazara/Network/NetBuffer.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright (C) 2017 Jérôme Leclercq
|
||||
// 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_NETBUFFER_HPP
|
||||
#define NAZARA_NETBUFFER_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
struct NetBuffer
|
||||
{
|
||||
void* data;
|
||||
std::size_t dataLength;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_NETBUFFER_HPP
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <Nazara/Core/Stream.hpp>
|
||||
#include <Nazara/Network/AbstractSocket.hpp>
|
||||
#include <Nazara/Network/IpAddress.hpp>
|
||||
#include <Nazara/Network/NetBuffer.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
@@ -49,6 +50,7 @@ namespace Nz
|
||||
bool ReceivePacket(NetPacket* packet);
|
||||
|
||||
bool Send(const void* buffer, std::size_t size, std::size_t* sent);
|
||||
bool SendMultiple(const NetBuffer* buffers, std::size_t bufferCount, std::size_t* sent);
|
||||
bool SendPacket(const NetPacket& packet);
|
||||
|
||||
bool SetCursorPos(UInt64 offset) override;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2017 Jérôme Leclercq
|
||||
// Copyright (C) 2017 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Network module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Network/AbstractSocket.hpp>
|
||||
#include <Nazara/Network/IpAddress.hpp>
|
||||
#include <Nazara/Network/NetBuffer.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
@@ -29,7 +30,7 @@ namespace Nz
|
||||
inline bool Create(NetProtocol protocol);
|
||||
|
||||
void EnableBroadcasting(bool broadcasting);
|
||||
|
||||
|
||||
inline IpAddress GetBoundAddress() const;
|
||||
inline UInt16 GetBoundPort() const;
|
||||
inline SocketState GetState() const;
|
||||
@@ -42,6 +43,7 @@ namespace Nz
|
||||
bool ReceivePacket(NetPacket* packet, IpAddress* from);
|
||||
|
||||
bool Send(const IpAddress& to, const void* buffer, std::size_t size, std::size_t* sent);
|
||||
bool SendMultiple(const IpAddress& to, const NetBuffer* buffers, std::size_t bufferCount, std::size_t* sent);
|
||||
bool SendPacket(const IpAddress& to, const NetPacket& packet);
|
||||
|
||||
private:
|
||||
@@ -55,4 +57,4 @@ namespace Nz
|
||||
|
||||
#include <Nazara/Network/UdpSocket.inl>
|
||||
|
||||
#endif // NAZARA_UDPSOCKET_HPP
|
||||
#endif // NAZARA_UDPSOCKET_HPP
|
||||
|
||||
Reference in New Issue
Block a user