Lumiera  0.pre.03
»edityourfreedom«
diagnostic-buffer-provider.hpp
Go to the documentation of this file.
1 /*
2  DIAGNOSTIC-BUFFER-PROVIDER.hpp - helper for testing against the BufferProvider interface
3 
4  Copyright (C) Lumiera.org
5  2011, 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 
29 #ifndef PROC_ENGINE_DIAGNOSTIC_BUFFR_PROVIDER_H
30 #define PROC_ENGINE_DIAGNOSTIC_BUFFR_PROVIDER_H
31 
32 
33 #include "lib/error.hpp"
34 #include "lib/depend.hpp"
35 #include "lib/util.hpp"
38 #include "lib/nocopy.hpp"
39 
40 #include <memory>
41 
42 
43 namespace proc {
44 namespace engine {
45 
46  namespace error = lumiera::error;
47 
48 
53  class TrackingHeapBlockProvider;
54 
55 
56  /****************************************************************/
63  {
64 
65  std::unique_ptr<TrackingHeapBlockProvider> pImpl_;
67 
68 
70  bool isCurrent (BufferProvider const&);
71 
72 
75 
77 
78  public:
82  static BufferProvider& build();
83 
84 
90  access (BufferProvider const& );
91 
92 
93 
94 
95  /* === diagnostic API === */
96 
97  bool buffer_was_used (uint bufferID) const;
98  bool buffer_was_closed (uint bufferID) const;
99  void* accessMemory (uint bufferID) const;
100  bool all_buffers_released() const;
101 
102 
103 
104  private:
105 
106  };
107 
108 
109 
110 }} // namespace proc::engine
111 #endif
simple BufferProvider implementation with additional allocation tracking.
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
Helper for unit tests: Buffer provider reference implementation.
Interface: a facility providing and managing working buffers for media calculations.
std::unique_ptr< TrackingHeapBlockProvider > pImpl_
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:289
static DiagnosticBufferProvider & access(BufferProvider const &)
access the diagnostic API of the buffer provider
static lib::Depend< DiagnosticBufferProvider > diagnostics
Storage for the diagnostics frontend.
static BufferProvider & build()
build a new Diagnostic Buffer Provider instance, discard the existing one.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Singleton services and Dependency Injection.
Helper holding a pair of type-build-up and destruction functors.
Lumiera error handling (C++ interface).
Helper to abstract creation and lifecycle of a dependency.
Definition: depend.hpp:134
Proc-Layer implementation namespace root.
Definition: id-scheme.hpp:63
Abstraction to represent buffer management and lifecycle within the render engine.