Improved code
Former-commit-id: 33082b8f9d55c7a3b9550c788eb27fc613c08032
This commit is contained in:
@@ -17,25 +17,7 @@ class NzThreadImpl;
|
||||
class NAZARA_API NzThread : NzNonCopyable
|
||||
{
|
||||
public:
|
||||
class NAZARA_API Id
|
||||
{
|
||||
friend NzThread;
|
||||
|
||||
public:
|
||||
NAZARA_API friend bool operator==(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator!=(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator<(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator<=(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator>(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator>=(const Id& lhs, const Id& rhs);
|
||||
|
||||
NAZARA_API friend bool operator<<(std::ostream& o, const Id& id);
|
||||
|
||||
private:
|
||||
Id(NzThreadImpl* thread);
|
||||
|
||||
NzThreadImpl* m_id = nullptr;
|
||||
};
|
||||
class Id;
|
||||
|
||||
NzThread();
|
||||
template<typename F> NzThread(F function);
|
||||
@@ -60,6 +42,26 @@ class NAZARA_API NzThread : NzNonCopyable
|
||||
NzThreadImpl* m_impl;
|
||||
};
|
||||
|
||||
class NAZARA_API NzThread::Id
|
||||
{
|
||||
friend NzThread;
|
||||
|
||||
public:
|
||||
NAZARA_API friend bool operator==(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator!=(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator<(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator<=(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator>(const Id& lhs, const Id& rhs);
|
||||
NAZARA_API friend bool operator>=(const Id& lhs, const Id& rhs);
|
||||
|
||||
NAZARA_API friend bool operator<<(std::ostream& o, const Id& id);
|
||||
|
||||
private:
|
||||
Id(NzThreadImpl* thread);
|
||||
|
||||
NzThreadImpl* m_id = nullptr;
|
||||
};
|
||||
|
||||
#include <Nazara/Core/Thread.inl>
|
||||
|
||||
#endif // NAZARA_THREAD_HPP
|
||||
|
||||
Reference in New Issue
Block a user