Lockless Task Scheduler
v1.0a
A lockless task scheduler
include
internal
profilenone.h
1
// ***********************************************************************
2
// Assembly : task_scheduler
3
// Author : viknash
4
// ***********************************************************************
5
// <copyright file="profilenone.h" >
6
// Copyright (c) viknash. All rights reserved.
7
// </copyright>
8
// <summary></summary>
9
// ***********************************************************************
10
#pragma once
11
12
#include <thread>
13
14
#include "utils.h"
15
#include "containers.h"
16
20
namespace
task_scheduler
21
{
22
namespace
profile
23
{
24
25
#if TASK_SCHEDULER_PROFILER == TASK_SCHEDULER_PROFILER_NONE
26
class
basic_errors
27
{
28
public
:
29
inline
void
suppress(
enum
errors::type _error)
30
{
31
ts_unused(_error);
32
}
33
34
inline
void
unsuppress(
enum
errors::type _error)
35
{
36
ts_unused(_error);
37
}
38
};
39
40
static
errors
* instance()
41
{
42
static
error_stack<basic_errors>
error_instance;
43
return
&error_instance;
44
}
45
46
template
<
class
TKey>
47
memory
* memory::instance()
48
{
49
ts_always_assert();
50
return
nullptr
;
51
}
52
53
namespace
thread
54
{
55
inline
void
set_name(
const
tchar_t* _name)
56
{
57
ts_unused(_name);
58
}
59
}
60
61
class
null_string
62
{
63
typedef
void
* handle;
64
protected
:
65
66
null_string
(
const
tchar_t* _name)
67
{
68
ts_unused(_name);
69
};
70
71
typename
handle& operator* ()
72
{
73
static
handle
dummy
=
nullptr
;
74
return
dummy;
75
}
76
};
77
78
typedef
basic_string<null_string>
string
;
79
80
template
<
class
TKey>
81
static
domain
* domain::instance()
82
{
83
static
domain
static_domain;
84
return
&static_domain;
85
}
86
87
struct
task_param
88
{
89
task_param
(
function
_func,
const
tchar_t* _task_id,
const
tchar_t* _parent_task_id,
const
tchar_t* _task_name)
90
{}
91
};
92
93
class
task
94
{
95
96
public
:
97
98
task
()
99
{
100
}
101
102
bool
enter(
task_param
& _param)
103
{
104
ts_unused(_param);
105
return
true
;
106
}
107
108
bool
exit(
task_param
& _param)
109
{
110
ts_unused(_param);
111
return
true
;
112
}
113
};
114
115
typedef
scoped_enter_exit< profile::task, profile::task_param >
task_scoped_instrument
;
116
117
#endif
118
119
}
120
121
}
task_scheduler::profile::null_string
Definition:
profilenone.h:61
task_scheduler
Class stl_allocator.
Definition:
allocator.h:16
task_scheduler::profile::domain
Definition:
profilebase.h:212
task_scheduler::profile::error_stack
Definition:
profilebase.h:101
task_scheduler::profile::memory
Definition:
profilebase.h:128
task_scheduler::scoped_enter_exit
Class scoped_enter_exit.
Definition:
utils.h:140
task_scheduler::profile::basic_string
Definition:
profilebase.h:196
task_scheduler::profile::task
Definition:
profileitt.h:188
task_scheduler::dummy
Definition:
lockfreenode.h:19
task_scheduler::profile::errors
Definition:
profilebase.h:80
task_scheduler::profile::task_param
Definition:
profileitt.h:173
task_scheduler::profile::basic_errors
Definition:
profilenone.h:26
Generated by
1.8.13