Merge remote-tracking branch 'refs/remotes/origin/master' into enet_wip_nothing_to_see_here
This commit is contained in:
commit
c5c5beef92
|
|
@ -69,7 +69,7 @@ namespace Nz
|
||||||
SlotListIndex index;
|
SlotListIndex index;
|
||||||
};
|
};
|
||||||
|
|
||||||
void Disconnect(const SlotPtr& slot);
|
void Disconnect(const SlotPtr& slot) noexcept;
|
||||||
|
|
||||||
SlotList m_slots;
|
SlotList m_slots;
|
||||||
mutable SlotListIndex m_slotIterator;
|
mutable SlotListIndex m_slotIterator;
|
||||||
|
|
@ -84,17 +84,17 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
Connection() = default;
|
Connection() = default;
|
||||||
Connection(const Connection& connection) = default;
|
Connection(const Connection& connection) = default;
|
||||||
Connection(Connection&& connection) = default;
|
Connection(Connection&& connection) noexcept = default;
|
||||||
~Connection() = default;
|
~Connection() = default;
|
||||||
|
|
||||||
template<typename... ConnectArgs>
|
template<typename... ConnectArgs>
|
||||||
void Connect(BaseClass& signal, ConnectArgs&&... args);
|
void Connect(BaseClass& signal, ConnectArgs&&... args);
|
||||||
void Disconnect();
|
void Disconnect() noexcept;
|
||||||
|
|
||||||
bool IsConnected() const;
|
bool IsConnected() const;
|
||||||
|
|
||||||
Connection& operator=(const Connection& connection) = default;
|
Connection& operator=(const Connection& connection) = default;
|
||||||
Connection& operator=(Connection&& connection) = default;
|
Connection& operator=(Connection&& connection) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Connection(const SlotPtr& slot);
|
Connection(const SlotPtr& slot);
|
||||||
|
|
@ -113,12 +113,12 @@ namespace Nz
|
||||||
ConnectionGuard(const Connection& connection);
|
ConnectionGuard(const Connection& connection);
|
||||||
ConnectionGuard(const ConnectionGuard& connection) = delete;
|
ConnectionGuard(const ConnectionGuard& connection) = delete;
|
||||||
ConnectionGuard(Connection&& connection);
|
ConnectionGuard(Connection&& connection);
|
||||||
ConnectionGuard(ConnectionGuard&& connection) = default;
|
ConnectionGuard(ConnectionGuard&& connection) noexcept = default;
|
||||||
~ConnectionGuard();
|
~ConnectionGuard();
|
||||||
|
|
||||||
template<typename... ConnectArgs>
|
template<typename... ConnectArgs>
|
||||||
void Connect(BaseClass& signal, ConnectArgs&&... args);
|
void Connect(BaseClass& signal, ConnectArgs&&... args);
|
||||||
void Disconnect();
|
void Disconnect() noexcept;
|
||||||
|
|
||||||
Connection& GetConnection();
|
Connection& GetConnection();
|
||||||
|
|
||||||
|
|
@ -127,7 +127,7 @@ namespace Nz
|
||||||
ConnectionGuard& operator=(const Connection& connection);
|
ConnectionGuard& operator=(const Connection& connection);
|
||||||
ConnectionGuard& operator=(const ConnectionGuard& connection) = delete;
|
ConnectionGuard& operator=(const ConnectionGuard& connection) = delete;
|
||||||
ConnectionGuard& operator=(Connection&& connection);
|
ConnectionGuard& operator=(Connection&& connection);
|
||||||
ConnectionGuard& operator=(ConnectionGuard&& connection);
|
ConnectionGuard& operator=(ConnectionGuard&& connection) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Connection m_connection;
|
Connection m_connection;
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ namespace Nz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
void Signal<Args...>::Disconnect(const SlotPtr& slot)
|
void Signal<Args...>::Disconnect(const SlotPtr& slot) noexcept
|
||||||
{
|
{
|
||||||
NazaraAssert(slot, "Invalid slot pointer");
|
NazaraAssert(slot, "Invalid slot pointer");
|
||||||
NazaraAssert(slot->index < m_slots.size(), "Invalid slot index");
|
NazaraAssert(slot->index < m_slots.size(), "Invalid slot index");
|
||||||
|
|
@ -277,7 +277,7 @@ namespace Nz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
void Signal<Args...>::Connection::Disconnect()
|
void Signal<Args...>::Connection::Disconnect() noexcept
|
||||||
{
|
{
|
||||||
if (SlotPtr ptr = m_ptr.lock())
|
if (SlotPtr ptr = m_ptr.lock())
|
||||||
ptr->signal->Disconnect(ptr);
|
ptr->signal->Disconnect(ptr);
|
||||||
|
|
@ -353,7 +353,7 @@ namespace Nz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
void Signal<Args...>::ConnectionGuard::Disconnect()
|
void Signal<Args...>::ConnectionGuard::Disconnect() noexcept
|
||||||
{
|
{
|
||||||
m_connection.Disconnect();
|
m_connection.Disconnect();
|
||||||
}
|
}
|
||||||
|
|
@ -420,7 +420,7 @@ namespace Nz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
typename Signal<Args...>::ConnectionGuard& Signal<Args...>::ConnectionGuard::operator=(ConnectionGuard&& connection)
|
typename Signal<Args...>::ConnectionGuard& Signal<Args...>::ConnectionGuard::operator=(ConnectionGuard&& connection) noexcept
|
||||||
{
|
{
|
||||||
m_connection.Disconnect();
|
m_connection.Disconnect();
|
||||||
m_connection = std::move(connection.m_connection);
|
m_connection = std::move(connection.m_connection);
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,8 @@ namespace Nz
|
||||||
std::vector<PostStep> funcs;
|
std::vector<PostStep> funcs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static_assert(std::is_nothrow_move_constructible<PostStepContainer>::value, "PostStepContainer should be noexcept MoveConstructible");
|
||||||
|
|
||||||
std::unordered_map<cpCollisionHandler*, std::unique_ptr<Callback>> m_callbacks;
|
std::unordered_map<cpCollisionHandler*, std::unique_ptr<Callback>> m_callbacks;
|
||||||
std::unordered_map<RigidBody2D*, PostStepContainer> m_rigidPostSteps;
|
std::unordered_map<RigidBody2D*, PostStepContainer> m_rigidPostSteps;
|
||||||
cpSpace* m_handle;
|
cpSpace* m_handle;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue