Lumiera
0.pre.03
»edit your freedom«
nobug-resource-handle-context.hpp
Go to the documentation of this file.
1
/*
2
NOBUG-RESOURCE-HANDLE-CONTEXT.hpp - thread local stack to manage NoBug resource handles
3
4
Copyright (C) Lumiera.org
5
2010, Hermann Vosseler <Ichthyostega@web.de>
6
7
This program is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License as
9
published by the Free Software Foundation; either version 2 of
10
the License, or (at your option) any later version.
11
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21
*/
22
43
#ifndef LIB_NOBUG_RESOURCE_HANDLE_CONTEXT_H
44
#define LIB_NOBUG_RESOURCE_HANDLE_CONTEXT_H
45
46
47
#include "
lib/error.hpp
"
48
#include "
lib/diagnostic-context.hpp
"
49
#include "lib/thread-local.hpp"
50
51
#include <nobug.h>
52
53
54
55
namespace
lib
{
56
57
58
59
#ifdef NOBUG_MODE_ALPHA
60
61
66
class
NobugResourceHandleContext
67
: DiagnosticContext<nobug_resource_user*>
68
{
69
public
:
70
};
71
72
73
#else
/* not NOBUG_ALPHA */
74
75
79
class
NobugResourceHandleContext
80
:
util::NonCopyable
81
{
82
83
typedef
nobug_resource_user* Handle;
84
85
public
:
86
87
operator
Handle ()
88
{
89
return
0;
90
}
91
93
static
NobugResourceHandleContext
&
94
access
()
95
{
96
UNIMPLEMENTED (
"how to disable DiagnosticContext with minimum overhead"
);
97
}
98
};
99
#endif
/* NOBUG_ALPHA? */
100
101
102
103
}
// namespace lib
104
#endif
lib::NobugResourceHandleContext::access
static NobugResourceHandleContext & access()
accessing the innermost diagnostic context created
Definition:
nobug-resource-handle-context.hpp:94
util::NonCopyable
Any copy and copy construction prohibited.
Definition:
nocopy.hpp:46
diagnostic-context.hpp
Facility for collecting diagnostic context information explicitly.
lib
Implementation namespace for support and library code.
Definition:
common-services.cpp:63
lib::NobugResourceHandleContext
Disabled placeholder for the Diagnostic context, not used in release builds.
Definition:
nobug-resource-handle-context.hpp:79
error.hpp
Lumiera error handling (C++ interface).
lib
nobug-resource-handle-context.hpp
Generated on Sat Apr 20 2024 02:03:40 for Lumiera by
1.8.13