Improved code

Former-commit-id: 33082b8f9d55c7a3b9550c788eb27fc613c08032
This commit is contained in:
Lynix
2013-06-05 13:24:33 +02:00
parent a1da3395cd
commit fbc0d7404e
4 changed files with 65 additions and 65 deletions

View File

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