Noexcept all the things!

This commit is contained in:
Jérôme Leclercq
2018-06-12 11:37:44 +02:00
parent 456f2b32e7
commit 15f84dc712
37 changed files with 72 additions and 91 deletions

View File

@@ -19,7 +19,7 @@ namespace Nz
{
public:
AbstractSocket(const AbstractSocket&) = delete;
AbstractSocket(AbstractSocket&& abstractSocket);
AbstractSocket(AbstractSocket&& abstractSocket) noexcept;
virtual ~AbstractSocket();
void Close();

View File

@@ -135,7 +135,7 @@ namespace Nz
std::vector<ENetPeer> m_peers;
std::vector<PendingIncomingPacket> m_pendingIncomingPackets;
std::vector<PendingOutgoingPacket> m_pendingOutgoingPackets;
UInt8* m_receivedData;
MovablePtr<UInt8> m_receivedData;
Bitset<UInt64> m_dispatchQueue;
MemoryPool m_packetPool;
IpAddress m_address;

View File

@@ -1,4 +1,4 @@
/*
/*
Copyright(c) 2002 - 2016 Lee Salzman
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
@@ -19,6 +19,7 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Core/Bitset.hpp>
#include <Nazara/Core/MovablePtr.hpp>
#include <Nazara/Network/ENetPacket.hpp>
#include <Nazara/Network/ENetProtocol.hpp>
#include <Nazara/Network/IpAddress.hpp>
@@ -176,8 +177,8 @@ namespace Nz
static constexpr std::size_t unsequencedWindow = ENetPeer_ReliableWindowSize / 32;
ENetHost* m_host;
IpAddress m_address; /**< Internet address of the peer */
MovablePtr<ENetHost> m_host;
IpAddress m_address; //< Internet address of the peer
std::array<UInt32, unsequencedWindow> m_unsequencedWindow;
std::bernoulli_distribution m_packetLossProbability;
std::list<IncomingCommmand> m_dispatchedCommands;

View File

@@ -32,7 +32,7 @@ namespace Nz
inline explicit IpAddress(const char* address);
inline explicit IpAddress(const String& address);
IpAddress(const IpAddress&) = default;
IpAddress(IpAddress&&) = default;
IpAddress(IpAddress&&) noexcept = default;
~IpAddress() = default;
bool BuildFromAddress(const char* address);
@@ -53,7 +53,7 @@ namespace Nz
inline explicit operator bool() const;
IpAddress& operator=(const IpAddress&) = default;
IpAddress& operator=(IpAddress&&) = default;
IpAddress& operator=(IpAddress&&) noexcept = default;
static String ResolveAddress(const IpAddress& address, String* service = nullptr, ResolveError* error = nullptr);
static std::vector<HostnameInfo> ResolveHostname(NetProtocol procol, const String& hostname, const String& protocol = "http", ResolveError* error = nullptr);

View File

@@ -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

View File

@@ -24,7 +24,7 @@ namespace Nz
public:
inline TcpClient();
TcpClient(TcpClient&& tcpClient) = default;
TcpClient(TcpClient&& tcpClient) noexcept = default;
~TcpClient() = default;
SocketState Connect(const IpAddress& remoteAddress);

View File

@@ -21,7 +21,7 @@ namespace Nz
public:
inline UdpSocket();
inline UdpSocket(NetProtocol protocol);
inline UdpSocket(UdpSocket&& udpSocket);
inline UdpSocket(UdpSocket&& udpSocket) noexcept;
~UdpSocket() = default;
inline SocketState Bind(UInt16 port);

View File

@@ -33,7 +33,7 @@ namespace Nz
* \param udpSocket UdpSocket to move into this
*/
inline UdpSocket::UdpSocket(UdpSocket&& udpSocket) :
inline UdpSocket::UdpSocket(UdpSocket&& udpSocket) noexcept :
AbstractSocket(std::move(udpSocket)),
m_boundAddress(std::move(udpSocket.m_boundAddress))
{