Noexcept all the things!
This commit is contained in:
parent
456f2b32e7
commit
15f84dc712
|
|
@ -111,6 +111,7 @@ Nazara Engine:
|
||||||
- InstancedRenderable::SetMaterial methods are now public.
|
- InstancedRenderable::SetMaterial methods are now public.
|
||||||
- Fixed Model copy constructor not copying materials
|
- Fixed Model copy constructor not copying materials
|
||||||
- ⚠️ Added InstancedRenderable::Clone() method
|
- ⚠️ Added InstancedRenderable::Clone() method
|
||||||
|
- Fixed a lot of classes not having their move constructor/assignation operator marked noexcept
|
||||||
|
|
||||||
Nazara Development Kit:
|
Nazara Development Kit:
|
||||||
- Added ImageWidget (#139)
|
- Added ImageWidget (#139)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace Ndk
|
||||||
using Factory = std::function<BaseComponent*()>;
|
using Factory = std::function<BaseComponent*()>;
|
||||||
|
|
||||||
BaseComponent(ComponentIndex componentIndex);
|
BaseComponent(ComponentIndex componentIndex);
|
||||||
BaseComponent(BaseComponent&&) = default;
|
BaseComponent(BaseComponent&&) noexcept = default;
|
||||||
virtual ~BaseComponent();
|
virtual ~BaseComponent();
|
||||||
|
|
||||||
virtual std::unique_ptr<BaseComponent> Clone() const = 0;
|
virtual std::unique_ptr<BaseComponent> Clone() const = 0;
|
||||||
|
|
@ -34,7 +34,7 @@ namespace Ndk
|
||||||
inline static ComponentIndex GetMaxComponentIndex();
|
inline static ComponentIndex GetMaxComponentIndex();
|
||||||
|
|
||||||
BaseComponent& operator=(const BaseComponent&) = delete;
|
BaseComponent& operator=(const BaseComponent&) = delete;
|
||||||
BaseComponent& operator=(BaseComponent&&) = default;
|
BaseComponent& operator=(BaseComponent&&) noexcept = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BaseComponent(const BaseComponent&) = default;
|
BaseComponent(const BaseComponent&) = default;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Ndk
|
||||||
|
|
||||||
BaseWidget(BaseWidget* parent);
|
BaseWidget(BaseWidget* parent);
|
||||||
BaseWidget(const BaseWidget&) = delete;
|
BaseWidget(const BaseWidget&) = delete;
|
||||||
BaseWidget(BaseWidget&&) = default;
|
BaseWidget(BaseWidget&&) = delete;
|
||||||
virtual ~BaseWidget();
|
virtual ~BaseWidget();
|
||||||
|
|
||||||
template<typename T, typename... Args> T* Add(Args&&... args);
|
template<typename T, typename... Args> T* Add(Args&&... args);
|
||||||
|
|
@ -72,7 +72,7 @@ namespace Ndk
|
||||||
void Show(bool show = true);
|
void Show(bool show = true);
|
||||||
|
|
||||||
BaseWidget& operator=(const BaseWidget&) = delete;
|
BaseWidget& operator=(const BaseWidget&) = delete;
|
||||||
BaseWidget& operator=(BaseWidget&&) = default;
|
BaseWidget& operator=(BaseWidget&&) = delete;
|
||||||
|
|
||||||
struct Padding
|
struct Padding
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@ namespace Ndk
|
||||||
public:
|
public:
|
||||||
System();
|
System();
|
||||||
System(const System&) = delete;
|
System(const System&) = delete;
|
||||||
System(System&&) = default;
|
System(System&&) noexcept = default;
|
||||||
virtual ~System();
|
virtual ~System();
|
||||||
|
|
||||||
System& operator=(const System&) = delete;
|
System& operator=(const System&) = delete;
|
||||||
System& operator=(System&&) = default;
|
System& operator=(System&&) noexcept = default;
|
||||||
|
|
||||||
static SystemIndex RegisterSystem();
|
static SystemIndex RegisterSystem();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (C) 2017 Samy Bensaid
|
// Copyright (C) 2017 Samy Bensaid
|
||||||
// This file is part of the "Nazara Development Kit"
|
// This file is part of the "Nazara Development Kit"
|
||||||
// For conditions of distribution and use, see copyright notice in Prerequisites.hpp
|
// For conditions of distribution and use, see copyright notice in Prerequisites.hpp
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
AbstractHash() = default;
|
AbstractHash() = default;
|
||||||
AbstractHash(const AbstractHash&) = delete;
|
AbstractHash(const AbstractHash&) = delete;
|
||||||
AbstractHash(AbstractHash&&) = default;
|
AbstractHash(AbstractHash&&) noexcept = default;
|
||||||
virtual ~AbstractHash();
|
virtual ~AbstractHash();
|
||||||
|
|
||||||
virtual void Append(const UInt8* data, std::size_t len) = 0;
|
virtual void Append(const UInt8* data, std::size_t len) = 0;
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Nz
|
||||||
virtual const char* GetHashName() const = 0;
|
virtual const char* GetHashName() const = 0;
|
||||||
|
|
||||||
AbstractHash& operator=(const AbstractHash&) = delete;
|
AbstractHash& operator=(const AbstractHash&) = delete;
|
||||||
AbstractHash& operator=(AbstractHash&&) = default;
|
AbstractHash& operator=(AbstractHash&&) noexcept = default;
|
||||||
|
|
||||||
static std::unique_ptr<AbstractHash> Get(HashType hash);
|
static std::unique_ptr<AbstractHash> Get(HashType hash);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ namespace Nz
|
||||||
inline ByteArray(size_type n, value_type value);
|
inline ByteArray(size_type n, value_type value);
|
||||||
template <class InputIterator> ByteArray(InputIterator first, InputIterator last);
|
template <class InputIterator> ByteArray(InputIterator first, InputIterator last);
|
||||||
ByteArray(const ByteArray& other) = default;
|
ByteArray(const ByteArray& other) = default;
|
||||||
ByteArray(ByteArray&& other) = default;
|
ByteArray(ByteArray&& other) noexcept = default;
|
||||||
~ByteArray() = default;
|
~ByteArray() = default;
|
||||||
|
|
||||||
inline iterator Append(const void* buffer, size_type size);
|
inline iterator Append(const void* buffer, size_type size);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace Nz
|
||||||
ByteStream(void* ptr, Nz::UInt64 size);
|
ByteStream(void* ptr, Nz::UInt64 size);
|
||||||
ByteStream(const void* ptr, Nz::UInt64 size);
|
ByteStream(const void* ptr, Nz::UInt64 size);
|
||||||
ByteStream(const ByteStream&) = delete;
|
ByteStream(const ByteStream&) = delete;
|
||||||
inline ByteStream(ByteStream&& stream);
|
ByteStream(ByteStream&& stream) noexcept = default;
|
||||||
virtual ~ByteStream();
|
virtual ~ByteStream();
|
||||||
|
|
||||||
inline Endianness GetDataEndianness() const;
|
inline Endianness GetDataEndianness() const;
|
||||||
|
|
@ -50,7 +50,7 @@ namespace Nz
|
||||||
ByteStream& operator<<(const T& value);
|
ByteStream& operator<<(const T& value);
|
||||||
|
|
||||||
ByteStream& operator=(const ByteStream&) = delete;
|
ByteStream& operator=(const ByteStream&) = delete;
|
||||||
inline ByteStream& operator=(ByteStream&&);
|
ByteStream& operator=(ByteStream&&) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void OnEmptyStream();
|
virtual void OnEmptyStream();
|
||||||
|
|
|
||||||
|
|
@ -16,19 +16,6 @@ namespace Nz
|
||||||
m_context.stream = stream;
|
m_context.stream = stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Constructs a ByteStream object by move semantic
|
|
||||||
*
|
|
||||||
* \param stream ByteStream to move into this
|
|
||||||
*/
|
|
||||||
|
|
||||||
inline ByteStream::ByteStream(ByteStream&& stream) :
|
|
||||||
m_ownedStream(std::move(stream.m_ownedStream)),
|
|
||||||
m_context(stream.m_context)
|
|
||||||
{
|
|
||||||
stream.m_context.stream = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Destructs the object and calls FlushBits
|
* \brief Destructs the object and calls FlushBits
|
||||||
*
|
*
|
||||||
|
|
@ -204,23 +191,6 @@ namespace Nz
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Moves the other byte stream into this
|
|
||||||
* \return A reference to this
|
|
||||||
*
|
|
||||||
* \param stream ByteStream to move in this
|
|
||||||
*/
|
|
||||||
|
|
||||||
inline ByteStream& ByteStream::operator=(ByteStream&& stream)
|
|
||||||
{
|
|
||||||
m_context = stream.m_context;
|
|
||||||
m_ownedStream = std::move(stream.m_ownedStream);
|
|
||||||
|
|
||||||
stream.m_context.stream = nullptr;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,14 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
CallOnExit(Func func = nullptr);
|
CallOnExit(Func func = nullptr);
|
||||||
CallOnExit(const CallOnExit&) = delete;
|
CallOnExit(const CallOnExit&) = delete;
|
||||||
CallOnExit(CallOnExit&&) = delete;
|
CallOnExit(CallOnExit&&) noexcept = delete;
|
||||||
~CallOnExit();
|
~CallOnExit();
|
||||||
|
|
||||||
void CallAndReset(Func func = nullptr);
|
void CallAndReset(Func func = nullptr);
|
||||||
void Reset(Func func = nullptr);
|
void Reset(Func func = nullptr);
|
||||||
|
|
||||||
CallOnExit& operator=(const CallOnExit&) = delete;
|
CallOnExit& operator=(const CallOnExit&) = delete;
|
||||||
CallOnExit& operator=(CallOnExit&&) = default;
|
CallOnExit& operator=(CallOnExit&&) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Func m_func;
|
Func m_func;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
FileLogger(const String& logPath = "NazaraLog.log");
|
FileLogger(const String& logPath = "NazaraLog.log");
|
||||||
FileLogger(const FileLogger&) = default;
|
FileLogger(const FileLogger&) = default;
|
||||||
FileLogger(FileLogger&&) = default;
|
FileLogger(FileLogger&&) noexcept = default;
|
||||||
~FileLogger();
|
~FileLogger();
|
||||||
|
|
||||||
void EnableTimeLogging(bool enable);
|
void EnableTimeLogging(bool enable);
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Nz
|
||||||
void WriteError(ErrorType type, const String& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override;
|
void WriteError(ErrorType type, const String& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override;
|
||||||
|
|
||||||
FileLogger& operator=(const FileLogger&) = default;
|
FileLogger& operator=(const FileLogger&) = default;
|
||||||
FileLogger& operator=(FileLogger&&) = default;
|
FileLogger& operator=(FileLogger&&) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
File m_outputFile;
|
File m_outputFile;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Nz
|
||||||
GuillotineBinPack(unsigned int width, unsigned int height);
|
GuillotineBinPack(unsigned int width, unsigned int height);
|
||||||
GuillotineBinPack(const Vector2ui& size);
|
GuillotineBinPack(const Vector2ui& size);
|
||||||
GuillotineBinPack(const GuillotineBinPack&) = default;
|
GuillotineBinPack(const GuillotineBinPack&) = default;
|
||||||
GuillotineBinPack(GuillotineBinPack&&) = default;
|
GuillotineBinPack(GuillotineBinPack&&) noexcept = default;
|
||||||
~GuillotineBinPack() = default;
|
~GuillotineBinPack() = default;
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
@ -52,7 +52,7 @@ namespace Nz
|
||||||
void Reset(const Vector2ui& size);
|
void Reset(const Vector2ui& size);
|
||||||
|
|
||||||
GuillotineBinPack& operator=(const GuillotineBinPack&) = default;
|
GuillotineBinPack& operator=(const GuillotineBinPack&) = default;
|
||||||
GuillotineBinPack& operator=(GuillotineBinPack&&) = default;
|
GuillotineBinPack& operator=(GuillotineBinPack&&) noexcept = default;
|
||||||
|
|
||||||
enum FreeRectChoiceHeuristic : int
|
enum FreeRectChoiceHeuristic : int
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#define NAZARA_MEMORYSTREAM_HPP
|
#define NAZARA_MEMORYSTREAM_HPP
|
||||||
|
|
||||||
#include <Nazara/Prerequisites.hpp>
|
#include <Nazara/Prerequisites.hpp>
|
||||||
|
#include <Nazara/Core/MovablePtr.hpp>
|
||||||
#include <Nazara/Core/Stream.hpp>
|
#include <Nazara/Core/Stream.hpp>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
|
|
@ -20,7 +21,7 @@ namespace Nz
|
||||||
inline MemoryStream();
|
inline MemoryStream();
|
||||||
inline MemoryStream(ByteArray* byteArray, OpenModeFlags openMode = OpenMode_ReadWrite);
|
inline MemoryStream(ByteArray* byteArray, OpenModeFlags openMode = OpenMode_ReadWrite);
|
||||||
MemoryStream(const MemoryStream&) = default;
|
MemoryStream(const MemoryStream&) = default;
|
||||||
MemoryStream(MemoryStream&&) = default;
|
MemoryStream(MemoryStream&&) noexcept = default;
|
||||||
~MemoryStream() = default;
|
~MemoryStream() = default;
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
@ -36,14 +37,14 @@ namespace Nz
|
||||||
bool SetCursorPos(UInt64 offset) override;
|
bool SetCursorPos(UInt64 offset) override;
|
||||||
|
|
||||||
MemoryStream& operator=(const MemoryStream&) = default;
|
MemoryStream& operator=(const MemoryStream&) = default;
|
||||||
MemoryStream& operator=(MemoryStream&&) = default;
|
MemoryStream& operator=(MemoryStream&&) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void FlushStream() override;
|
void FlushStream() override;
|
||||||
std::size_t ReadBlock(void* buffer, std::size_t size) override;
|
std::size_t ReadBlock(void* buffer, std::size_t size) override;
|
||||||
std::size_t WriteBlock(const void* buffer, std::size_t size) override;
|
std::size_t WriteBlock(const void* buffer, std::size_t size) override;
|
||||||
|
|
||||||
ByteArray* m_buffer;
|
MovablePtr<ByteArray> m_buffer;
|
||||||
UInt64 m_pos;
|
UInt64 m_pos;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include <Nazara/Prerequisites.hpp>
|
#include <Nazara/Prerequisites.hpp>
|
||||||
#include <Nazara/Core/Color.hpp>
|
#include <Nazara/Core/Color.hpp>
|
||||||
|
#include <Nazara/Core/MovablePtr.hpp>
|
||||||
#include <Nazara/Core/String.hpp>
|
#include <Nazara/Core/String.hpp>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
@ -72,7 +73,7 @@ namespace Nz
|
||||||
|
|
||||||
std::atomic_uint counter;
|
std::atomic_uint counter;
|
||||||
Destructor destructor;
|
Destructor destructor;
|
||||||
void* ptr;
|
MovablePtr<void> ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
ParameterType type;
|
ParameterType type;
|
||||||
|
|
@ -81,6 +82,7 @@ namespace Nz
|
||||||
// We define an empty constructor/destructor, to be able to put classes in the union
|
// We define an empty constructor/destructor, to be able to put classes in the union
|
||||||
Value() {}
|
Value() {}
|
||||||
Value(const Value&) {} // Placeholder
|
Value(const Value&) {} // Placeholder
|
||||||
|
Value(Value&&) noexcept {} // Placeholder
|
||||||
~Value() {}
|
~Value() {}
|
||||||
|
|
||||||
bool boolVal;
|
bool boolVal;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
PrimitiveList() = default;
|
PrimitiveList() = default;
|
||||||
PrimitiveList(const PrimitiveList&) = default;
|
PrimitiveList(const PrimitiveList&) = default;
|
||||||
PrimitiveList(PrimitiveList&&) = default;
|
PrimitiveList(PrimitiveList&&) noexcept = default;
|
||||||
~PrimitiveList() = default;
|
~PrimitiveList() = default;
|
||||||
|
|
||||||
void AddBox(const Vector3f& lengths, const Vector3ui& subdivision = Vector3ui(0U), const Matrix4f& transformMatrix = Matrix4f::Identity());
|
void AddBox(const Vector3f& lengths, const Vector3ui& subdivision = Vector3ui(0U), const Matrix4f& transformMatrix = Matrix4f::Identity());
|
||||||
|
|
@ -41,7 +41,7 @@ namespace Nz
|
||||||
std::size_t GetSize() const;
|
std::size_t GetSize() const;
|
||||||
|
|
||||||
PrimitiveList& operator=(const PrimitiveList&) = default;
|
PrimitiveList& operator=(const PrimitiveList&) = default;
|
||||||
PrimitiveList& operator=(PrimitiveList&&) = default;
|
PrimitiveList& operator=(PrimitiveList&&) noexcept = default;
|
||||||
|
|
||||||
Primitive& operator()(unsigned int i);
|
Primitive& operator()(unsigned int i);
|
||||||
const Primitive& operator()(unsigned int i) const;
|
const Primitive& operator()(unsigned int i) const;
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
RefCounted(bool persistent = true);
|
RefCounted(bool persistent = true);
|
||||||
RefCounted(const RefCounted&) = delete;
|
RefCounted(const RefCounted&) = delete;
|
||||||
RefCounted(RefCounted&&) = default;
|
RefCounted(RefCounted&&) = delete;
|
||||||
virtual ~RefCounted();
|
virtual ~RefCounted();
|
||||||
|
|
||||||
void AddReference() const;
|
void AddReference() const;
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Nz
|
||||||
bool SetPersistent(bool persistent = true, bool checkReferenceCount = false);
|
bool SetPersistent(bool persistent = true, bool checkReferenceCount = false);
|
||||||
|
|
||||||
RefCounted& operator=(const RefCounted&) = delete;
|
RefCounted& operator=(const RefCounted&) = delete;
|
||||||
RefCounted& operator=(RefCounted&&) = default;
|
RefCounted& operator=(RefCounted&&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::atomic_bool m_persistent;
|
std::atomic_bool m_persistent;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include <Nazara/Prerequisites.hpp>
|
#include <Nazara/Prerequisites.hpp>
|
||||||
#include <Nazara/Core/Config.hpp>
|
#include <Nazara/Core/Config.hpp>
|
||||||
#include <Nazara/Core/Endianness.hpp>
|
#include <Nazara/Core/Endianness.hpp>
|
||||||
|
#include <Nazara/Core/MovablePtr.hpp>
|
||||||
#include <Nazara/Core/TypeTag.hpp>
|
#include <Nazara/Core/TypeTag.hpp>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
|
|
@ -18,7 +19,7 @@ namespace Nz
|
||||||
|
|
||||||
struct NAZARA_CORE_API SerializationContext
|
struct NAZARA_CORE_API SerializationContext
|
||||||
{
|
{
|
||||||
Stream* stream;
|
MovablePtr<Stream> stream;
|
||||||
Endianness endianness = Endianness_BigEndian; //< Default to Big Endian encoding
|
Endianness endianness = Endianness_BigEndian; //< Default to Big Endian encoding
|
||||||
UInt8 readBitPos = 8; //< 8 means no bit is currently read
|
UInt8 readBitPos = 8; //< 8 means no bit is currently read
|
||||||
UInt8 readByte; //< Undefined value, will be initialized at the first bit read
|
UInt8 readByte; //< Undefined value, will be initialized at the first bit read
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
StdLogger() = default;
|
StdLogger() = default;
|
||||||
StdLogger(const StdLogger&) = default;
|
StdLogger(const StdLogger&) = default;
|
||||||
StdLogger(StdLogger&&) = default;
|
StdLogger(StdLogger&&) noexcept = default;
|
||||||
~StdLogger();
|
~StdLogger();
|
||||||
|
|
||||||
void EnableStdReplication(bool enable) override;
|
void EnableStdReplication(bool enable) override;
|
||||||
|
|
@ -28,7 +28,7 @@ namespace Nz
|
||||||
void WriteError(ErrorType type, const String& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override;
|
void WriteError(ErrorType type, const String& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override;
|
||||||
|
|
||||||
StdLogger& operator=(const StdLogger&) = default;
|
StdLogger& operator=(const StdLogger&) = default;
|
||||||
StdLogger& operator=(StdLogger&&) = default;
|
StdLogger& operator=(StdLogger&&) noexcept = default;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Stream(const Stream&) = default;
|
Stream(const Stream&) = default;
|
||||||
Stream(Stream&&) = default;
|
Stream(Stream&&) noexcept = default;
|
||||||
virtual ~Stream();
|
virtual ~Stream();
|
||||||
|
|
||||||
virtual bool EndOfStream() const = 0;
|
virtual bool EndOfStream() const = 0;
|
||||||
|
|
@ -52,7 +52,7 @@ namespace Nz
|
||||||
inline std::size_t Write(const void* buffer, std::size_t size);
|
inline std::size_t Write(const void* buffer, std::size_t size);
|
||||||
|
|
||||||
Stream& operator=(const Stream&) = default;
|
Stream& operator=(const Stream&) = default;
|
||||||
Stream& operator=(Stream&&) = default;
|
Stream& operator=(Stream&&) noexcept = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
inline Stream(StreamOptionFlags streamOptions = StreamOption_None, OpenModeFlags openMode = OpenMode_NotOpen);
|
inline Stream(StreamOptionFlags streamOptions = StreamOption_None, OpenModeFlags openMode = OpenMode_NotOpen);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Nz
|
||||||
|
|
||||||
AbstractRenderQueue() = default;
|
AbstractRenderQueue() = default;
|
||||||
AbstractRenderQueue(const AbstractRenderQueue&) = delete;
|
AbstractRenderQueue(const AbstractRenderQueue&) = delete;
|
||||||
AbstractRenderQueue(AbstractRenderQueue&&) = default;
|
AbstractRenderQueue(AbstractRenderQueue&&) noexcept = default;
|
||||||
virtual ~AbstractRenderQueue();
|
virtual ~AbstractRenderQueue();
|
||||||
|
|
||||||
// Je ne suis vraiment pas fan du nombre de surcharges pour AddBillboards,
|
// Je ne suis vraiment pas fan du nombre de surcharges pour AddBillboards,
|
||||||
|
|
@ -55,7 +55,7 @@ namespace Nz
|
||||||
virtual void Clear(bool fully = false);
|
virtual void Clear(bool fully = false);
|
||||||
|
|
||||||
AbstractRenderQueue& operator=(const AbstractRenderQueue&) = delete;
|
AbstractRenderQueue& operator=(const AbstractRenderQueue&) = delete;
|
||||||
AbstractRenderQueue& operator=(AbstractRenderQueue&&) = default;
|
AbstractRenderQueue& operator=(AbstractRenderQueue&&) noexcept = default;
|
||||||
|
|
||||||
struct DirectionalLight
|
struct DirectionalLight
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
AbstractRenderTechnique();
|
AbstractRenderTechnique();
|
||||||
AbstractRenderTechnique(const AbstractRenderTechnique&) = delete;
|
AbstractRenderTechnique(const AbstractRenderTechnique&) = delete;
|
||||||
AbstractRenderTechnique(AbstractRenderTechnique&&) = default;
|
AbstractRenderTechnique(AbstractRenderTechnique&&) noexcept = default;
|
||||||
virtual ~AbstractRenderTechnique();
|
virtual ~AbstractRenderTechnique();
|
||||||
|
|
||||||
virtual void Clear(const SceneData& sceneData) const = 0;
|
virtual void Clear(const SceneData& sceneData) const = 0;
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Nz
|
||||||
virtual bool IsInstancingEnabled() const;
|
virtual bool IsInstancingEnabled() const;
|
||||||
|
|
||||||
AbstractRenderTechnique& operator=(const AbstractRenderTechnique&) = delete;
|
AbstractRenderTechnique& operator=(const AbstractRenderTechnique&) = delete;
|
||||||
AbstractRenderTechnique& operator=(AbstractRenderTechnique&&) = default;
|
AbstractRenderTechnique& operator=(AbstractRenderTechnique&&) noexcept = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_instancingEnabled;
|
bool m_instancingEnabled;
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,13 @@ namespace Nz
|
||||||
using Index = Nz::UInt64;
|
using Index = Nz::UInt64;
|
||||||
|
|
||||||
RenderQueueInternal() = default;
|
RenderQueueInternal() = default;
|
||||||
|
RenderQueueInternal(const RenderQueueInternal&) = default;
|
||||||
|
RenderQueueInternal(RenderQueueInternal&&) = default;
|
||||||
~RenderQueueInternal() = default;
|
~RenderQueueInternal() = default;
|
||||||
|
|
||||||
|
RenderQueueInternal& operator=(const RenderQueueInternal&) = default;
|
||||||
|
RenderQueueInternal& operator=(RenderQueueInternal&&) = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using RenderDataPair = std::pair<Index, std::size_t>;
|
using RenderDataPair = std::pair<Index, std::size_t>;
|
||||||
|
|
||||||
|
|
@ -39,7 +44,7 @@ namespace Nz
|
||||||
|
|
||||||
RenderQueue() = default;
|
RenderQueue() = default;
|
||||||
RenderQueue(const RenderQueue&) = default;
|
RenderQueue(const RenderQueue&) = default;
|
||||||
RenderQueue(RenderQueue&&) = default;
|
RenderQueue(RenderQueue&&) noexcept = default;
|
||||||
~RenderQueue() = default;
|
~RenderQueue() = default;
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
@ -55,7 +60,7 @@ namespace Nz
|
||||||
inline size_type size() const;
|
inline size_type size() const;
|
||||||
|
|
||||||
RenderQueue& operator=(const RenderQueue&) = default;
|
RenderQueue& operator=(const RenderQueue&) = default;
|
||||||
RenderQueue& operator=(RenderQueue&&) = default;
|
RenderQueue& operator=(RenderQueue&&) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const RenderData& GetData(std::size_t i) const;
|
const RenderData& GetData(std::size_t i) const;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
Renderable() = default;
|
Renderable() = default;
|
||||||
Renderable(const Renderable& renderable) = default;
|
Renderable(const Renderable& renderable) = default;
|
||||||
Renderable(Renderable&&) = default;
|
Renderable(Renderable&&) noexcept = default;
|
||||||
virtual ~Renderable();
|
virtual ~Renderable();
|
||||||
|
|
||||||
virtual void AddToRenderQueue(AbstractRenderQueue* renderQueue, const Matrix4f& transformMatrix) const = 0;
|
virtual void AddToRenderQueue(AbstractRenderQueue* renderQueue, const Matrix4f& transformMatrix) const = 0;
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Nz
|
||||||
virtual void UpdateBoundingVolume(const Matrix4f& transformMatrix);
|
virtual void UpdateBoundingVolume(const Matrix4f& transformMatrix);
|
||||||
|
|
||||||
Renderable& operator=(const Renderable& renderable) = default;
|
Renderable& operator=(const Renderable& renderable) = default;
|
||||||
Renderable& operator=(Renderable&& renderable) = default;
|
Renderable& operator=(Renderable&& renderable) noexcept = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void MakeBoundingVolume() const = 0;
|
virtual void MakeBoundingVolume() const = 0;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AbstractSocket(const AbstractSocket&) = delete;
|
AbstractSocket(const AbstractSocket&) = delete;
|
||||||
AbstractSocket(AbstractSocket&& abstractSocket);
|
AbstractSocket(AbstractSocket&& abstractSocket) noexcept;
|
||||||
virtual ~AbstractSocket();
|
virtual ~AbstractSocket();
|
||||||
|
|
||||||
void Close();
|
void Close();
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ namespace Nz
|
||||||
std::vector<ENetPeer> m_peers;
|
std::vector<ENetPeer> m_peers;
|
||||||
std::vector<PendingIncomingPacket> m_pendingIncomingPackets;
|
std::vector<PendingIncomingPacket> m_pendingIncomingPackets;
|
||||||
std::vector<PendingOutgoingPacket> m_pendingOutgoingPackets;
|
std::vector<PendingOutgoingPacket> m_pendingOutgoingPackets;
|
||||||
UInt8* m_receivedData;
|
MovablePtr<UInt8> m_receivedData;
|
||||||
Bitset<UInt64> m_dispatchQueue;
|
Bitset<UInt64> m_dispatchQueue;
|
||||||
MemoryPool m_packetPool;
|
MemoryPool m_packetPool;
|
||||||
IpAddress m_address;
|
IpAddress m_address;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
Copyright(c) 2002 - 2016 Lee Salzman
|
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 :
|
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/Prerequisites.hpp>
|
||||||
#include <Nazara/Core/Bitset.hpp>
|
#include <Nazara/Core/Bitset.hpp>
|
||||||
|
#include <Nazara/Core/MovablePtr.hpp>
|
||||||
#include <Nazara/Network/ENetPacket.hpp>
|
#include <Nazara/Network/ENetPacket.hpp>
|
||||||
#include <Nazara/Network/ENetProtocol.hpp>
|
#include <Nazara/Network/ENetProtocol.hpp>
|
||||||
#include <Nazara/Network/IpAddress.hpp>
|
#include <Nazara/Network/IpAddress.hpp>
|
||||||
|
|
@ -176,8 +177,8 @@ namespace Nz
|
||||||
|
|
||||||
static constexpr std::size_t unsequencedWindow = ENetPeer_ReliableWindowSize / 32;
|
static constexpr std::size_t unsequencedWindow = ENetPeer_ReliableWindowSize / 32;
|
||||||
|
|
||||||
ENetHost* m_host;
|
MovablePtr<ENetHost> m_host;
|
||||||
IpAddress m_address; /**< Internet address of the peer */
|
IpAddress m_address; //< Internet address of the peer
|
||||||
std::array<UInt32, unsequencedWindow> m_unsequencedWindow;
|
std::array<UInt32, unsequencedWindow> m_unsequencedWindow;
|
||||||
std::bernoulli_distribution m_packetLossProbability;
|
std::bernoulli_distribution m_packetLossProbability;
|
||||||
std::list<IncomingCommmand> m_dispatchedCommands;
|
std::list<IncomingCommmand> m_dispatchedCommands;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Nz
|
||||||
inline explicit IpAddress(const char* address);
|
inline explicit IpAddress(const char* address);
|
||||||
inline explicit IpAddress(const String& address);
|
inline explicit IpAddress(const String& address);
|
||||||
IpAddress(const IpAddress&) = default;
|
IpAddress(const IpAddress&) = default;
|
||||||
IpAddress(IpAddress&&) = default;
|
IpAddress(IpAddress&&) noexcept = default;
|
||||||
~IpAddress() = default;
|
~IpAddress() = default;
|
||||||
|
|
||||||
bool BuildFromAddress(const char* address);
|
bool BuildFromAddress(const char* address);
|
||||||
|
|
@ -53,7 +53,7 @@ namespace Nz
|
||||||
inline explicit operator bool() const;
|
inline explicit operator bool() const;
|
||||||
|
|
||||||
IpAddress& operator=(const IpAddress&) = default;
|
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 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);
|
static std::vector<HostnameInfo> ResolveHostname(NetProtocol procol, const String& hostname, const String& protocol = "http", ResolveError* error = nullptr);
|
||||||
|
|
|
||||||
|
|
@ -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"
|
// This file is part of the "Nazara Engine - Network module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace Nz
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline TcpClient();
|
inline TcpClient();
|
||||||
TcpClient(TcpClient&& tcpClient) = default;
|
TcpClient(TcpClient&& tcpClient) noexcept = default;
|
||||||
~TcpClient() = default;
|
~TcpClient() = default;
|
||||||
|
|
||||||
SocketState Connect(const IpAddress& remoteAddress);
|
SocketState Connect(const IpAddress& remoteAddress);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
inline UdpSocket();
|
inline UdpSocket();
|
||||||
inline UdpSocket(NetProtocol protocol);
|
inline UdpSocket(NetProtocol protocol);
|
||||||
inline UdpSocket(UdpSocket&& udpSocket);
|
inline UdpSocket(UdpSocket&& udpSocket) noexcept;
|
||||||
~UdpSocket() = default;
|
~UdpSocket() = default;
|
||||||
|
|
||||||
inline SocketState Bind(UInt16 port);
|
inline SocketState Bind(UInt16 port);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Nz
|
||||||
* \param udpSocket UdpSocket to move into this
|
* \param udpSocket UdpSocket to move into this
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline UdpSocket::UdpSocket(UdpSocket&& udpSocket) :
|
inline UdpSocket::UdpSocket(UdpSocket&& udpSocket) noexcept :
|
||||||
AbstractSocket(std::move(udpSocket)),
|
AbstractSocket(std::move(udpSocket)),
|
||||||
m_boundAddress(std::move(udpSocket.m_boundAddress))
|
m_boundAddress(std::move(udpSocket.m_boundAddress))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Nz
|
||||||
|
|
||||||
PhysWorld3D();
|
PhysWorld3D();
|
||||||
PhysWorld3D(const PhysWorld3D&) = delete;
|
PhysWorld3D(const PhysWorld3D&) = delete;
|
||||||
PhysWorld3D(PhysWorld3D&&) = default;
|
PhysWorld3D(PhysWorld3D&&) noexcept = default;
|
||||||
~PhysWorld3D();
|
~PhysWorld3D();
|
||||||
|
|
||||||
int CreateMaterial(String name = String());
|
int CreateMaterial(String name = String());
|
||||||
|
|
@ -61,7 +61,7 @@ namespace Nz
|
||||||
void Step(float timestep);
|
void Step(float timestep);
|
||||||
|
|
||||||
PhysWorld3D& operator=(const PhysWorld3D&) = delete;
|
PhysWorld3D& operator=(const PhysWorld3D&) = delete;
|
||||||
PhysWorld3D& operator=(PhysWorld3D&&) = default;
|
PhysWorld3D& operator=(PhysWorld3D&&) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Callback
|
struct Callback
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,13 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
CursorController() = default;
|
CursorController() = default;
|
||||||
CursorController(const CursorController&) = delete;
|
CursorController(const CursorController&) = delete;
|
||||||
CursorController(CursorController&&) = default;
|
CursorController(CursorController&&) noexcept = default;
|
||||||
~CursorController() = default;
|
~CursorController() = default;
|
||||||
|
|
||||||
inline void UpdateCursor(const CursorRef& cursor);
|
inline void UpdateCursor(const CursorRef& cursor);
|
||||||
|
|
||||||
CursorController& operator=(const CursorController&) = delete;
|
CursorController& operator=(const CursorController&) = delete;
|
||||||
CursorController& operator=(CursorController&&) = default;
|
CursorController& operator=(CursorController&&) noexcept = default;
|
||||||
|
|
||||||
NazaraSignal(OnCursorUpdated, const CursorController* /*cursorController*/, const CursorRef& /*cursor*/);
|
NazaraSignal(OnCursorUpdated, const CursorController* /*cursorController*/, const CursorRef& /*cursor*/);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,13 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
EventHandler() = default;
|
EventHandler() = default;
|
||||||
explicit EventHandler(const EventHandler&);
|
explicit EventHandler(const EventHandler&);
|
||||||
EventHandler(EventHandler&&) = default;
|
EventHandler(EventHandler&&) noexcept = default;
|
||||||
~EventHandler() = default;
|
~EventHandler() = default;
|
||||||
|
|
||||||
inline void Dispatch(const WindowEvent& event);
|
inline void Dispatch(const WindowEvent& event);
|
||||||
|
|
||||||
EventHandler& operator=(const EventHandler&) = delete;
|
EventHandler& operator=(const EventHandler&) = delete;
|
||||||
EventHandler& operator=(EventHandler&&) = default;
|
EventHandler& operator=(EventHandler&&) noexcept = default;
|
||||||
|
|
||||||
NazaraSignal(OnEvent, const EventHandler* /*eventHandler*/, const WindowEvent& /*event*/);
|
NazaraSignal(OnEvent, const EventHandler* /*eventHandler*/, const WindowEvent& /*event*/);
|
||||||
NazaraSignal(OnGainedFocus, const EventHandler* /*eventHandler*/);
|
NazaraSignal(OnGainedFocus, const EventHandler* /*eventHandler*/);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Nz
|
||||||
Buffer(BufferType type);
|
Buffer(BufferType type);
|
||||||
Buffer(BufferType type, UInt32 size, DataStorage storage = DataStorage_Software, BufferUsageFlags usage = 0);
|
Buffer(BufferType type, UInt32 size, DataStorage storage = DataStorage_Software, BufferUsageFlags usage = 0);
|
||||||
Buffer(const Buffer&) = delete;
|
Buffer(const Buffer&) = delete;
|
||||||
Buffer(Buffer&&) = default;
|
Buffer(Buffer&&) = delete;
|
||||||
~Buffer();
|
~Buffer();
|
||||||
|
|
||||||
bool CopyContent(const BufferRef& buffer);
|
bool CopyContent(const BufferRef& buffer);
|
||||||
|
|
@ -61,7 +61,7 @@ namespace Nz
|
||||||
void Unmap() const;
|
void Unmap() const;
|
||||||
|
|
||||||
Buffer& operator=(const Buffer&) = delete;
|
Buffer& operator=(const Buffer&) = delete;
|
||||||
Buffer& operator=(Buffer&&) = default;
|
Buffer& operator=(Buffer&&) = delete;
|
||||||
|
|
||||||
static bool IsStorageSupported(DataStorage storage);
|
static bool IsStorageSupported(DataStorage storage);
|
||||||
template<typename... Args> static BufferRef New(Args&&... args);
|
template<typename... Args> static BufferRef New(Args&&... args);
|
||||||
|
|
|
||||||
|
|
@ -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 - Utility module"
|
// This file is part of the "Nazara Engine - Utility module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace Nz
|
||||||
* \param abstractSocket AbstractSocket to move into this
|
* \param abstractSocket AbstractSocket to move into this
|
||||||
*/
|
*/
|
||||||
|
|
||||||
AbstractSocket::AbstractSocket(AbstractSocket&& abstractSocket) :
|
AbstractSocket::AbstractSocket(AbstractSocket&& abstractSocket) noexcept :
|
||||||
m_protocol(abstractSocket.m_protocol),
|
m_protocol(abstractSocket.m_protocol),
|
||||||
m_lastError(abstractSocket.m_lastError),
|
m_lastError(abstractSocket.m_lastError),
|
||||||
m_handle(abstractSocket.m_handle),
|
m_handle(abstractSocket.m_handle),
|
||||||
|
|
|
||||||
|
|
@ -489,7 +489,7 @@ namespace Nz
|
||||||
if (m_receivedDataLength < NazaraOffsetOf(ENetProtocolHeader, sentTime))
|
if (m_receivedDataLength < NazaraOffsetOf(ENetProtocolHeader, sentTime))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ENetProtocolHeader* header = reinterpret_cast<ENetProtocolHeader*>(m_receivedData);
|
ENetProtocolHeader* header = reinterpret_cast<ENetProtocolHeader*>(m_receivedData.Get());
|
||||||
|
|
||||||
UInt16 peerID = NetToHost(header->peerID);
|
UInt16 peerID = NetToHost(header->peerID);
|
||||||
UInt8 sessionID = (peerID & ENetProtocolHeaderSessionMask) >> ENetProtocolHeaderSessionShift;
|
UInt8 sessionID = (peerID & ENetProtocolHeaderSessionMask) >> ENetProtocolHeaderSessionShift;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue