7 #ifndef NAZARA_THREAD_HPP 8 #define NAZARA_THREAD_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Core/Functor.hpp> 12 #include <Nazara/Core/MovablePtr.hpp> 26 template<
typename F>
Thread(F
function);
27 template<
typename F,
typename... Args>
Thread(F
function, Args&&... args);
28 template<
typename C> Thread(
void (C::*
function)(), C*
object);
29 Thread(
const Thread&) =
delete;
30 Thread(Thread&& other) noexcept =
default;
35 bool IsJoinable()
const;
37 void SetName(
const String& name);
39 Thread& operator=(
const Thread&) =
delete;
40 Thread& operator=(Thread&& thread) noexcept =
default;
42 static unsigned int HardwareConcurrency();
43 static void SetCurrentThreadName(
const String& name);
44 static void Sleep(UInt32 milliseconds);
47 void CreateImpl(Functor* functor);
52 class NAZARA_CORE_API Thread::Id
57 NAZARA_CORE_API
friend bool operator==(
const Id& lhs,
const Id& rhs);
58 NAZARA_CORE_API
friend bool operator!=(
const Id& lhs,
const Id& rhs);
59 NAZARA_CORE_API
friend bool operator<(
const Id& lhs,
const Id& rhs);
60 NAZARA_CORE_API
friend bool operator<=(
const Id& lhs,
const Id& rhs);
61 NAZARA_CORE_API
friend bool operator>(
const Id& lhs,
const Id& rhs);
62 NAZARA_CORE_API
friend bool operator>=(
const Id& lhs,
const Id& rhs);
64 NAZARA_CORE_API
friend std::ostream& operator<<(std::ostream& o,
const Id&
id);
67 Id(ThreadImpl* thread);
69 ThreadImpl* m_id =
nullptr;
73 #include <Nazara/Core/Thread.inl> 75 #endif // NAZARA_THREAD_HPP Core class that represents a thread.
Definition: Thread.hpp:20
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
bool operator<(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1517
bool operator>(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1566
Core class that represents a string.
Definition: String.hpp:22
bool operator!=(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1503
bool operator==(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1469
bool operator>=(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1580
bool operator<=(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1552