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)
5  2010, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
34 #ifndef LIB_NOBUG_RESOURCE_HANDLE_CONTEXT_H
35 #define LIB_NOBUG_RESOURCE_HANDLE_CONTEXT_H
36 
37 
38 #include "lib/error.hpp"
40 #include "lib/thread-local.hpp"
41 
42 #include <nobug.h>
43 
44 
45 
46 namespace lib {
47 
48 
49 
50 #ifdef NOBUG_MODE_ALPHA
51 
52 
57  class NobugResourceHandleContext
58  : DiagnosticContext<nobug_resource_user*>
59  {
60  public:
61  };
62 
63 
64 #else /* not NOBUG_ALPHA */
65 
66 
72  {
73 
74  typedef nobug_resource_user* Handle;
75 
76  public:
77 
78  operator Handle ()
79  {
80  return 0;
81  }
82 
85  access ()
86  {
87  UNIMPLEMENTED ("how to disable DiagnosticContext with minimum overhead");
88  }
89  };
90 #endif /* NOBUG_ALPHA? */
91 
92 
93 
94 } // namespace lib
95 #endif
static NobugResourceHandleContext & access()
accessing the innermost diagnostic context created
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
Facility for collecting diagnostic context information explicitly.
Implementation namespace for support and library code.
Disabled placeholder for the Diagnostic context, not used in release builds.
Lumiera error handling (C++ interface).