YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Thread.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_THREAD_HPP
2
# define YAPOG_THREAD_HPP
3
4
# include <functional>
5
6
# include <SFML/System.hpp>
7
8
# include "
YAPOG/Macros.hpp
"
9
# include "
YAPOG/System/Time/Time.hpp
"
10
11
# define MEMBER_WORKER(MEMBER) \
12
std::bind (&MEMBER, this, std::placeholders::_1)
13
14
namespace
yap
15
{
16
typedef
sf::Mutex
Mutex
;
17
typedef
sf::Lock
Lock
;
18
19
class
YAPOG_LIB
Thread
20
{
21
DISALLOW_COPY
(
Thread
);
22
23
public
:
24
25
typedef
std::function<void (void)>
WorkerType
;
26
27
explicit
Thread
(
WorkerType
worker);
28
29
template
<
typename
FunctionType,
typename
ArgsType>
30
Thread
(FunctionType
function
, ArgsType args);
31
32
void
Launch ();
33
void
Stop ();
34
35
void
Wait ();
36
37
static
void
Sleep (
const
Time
& delay);
38
39
private
:
40
41
sf::Thread
thread_
;
42
};
43
}
// namespace yap
44
45
# include "
YAPOG/System/Thread/Thread.hxx
"
46
47
#endif // YAPOG_THREAD_HPP
YAPOG
include
YAPOG
System
Thread
Thread.hpp
Generated on Mon Sep 17 2012 22:24:24 for YAPOG by
1.8.1.1