Lumiera  0.pre.03
»edit your freedom«
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)
5  2011, 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 
20 #ifndef STEAM_ENGINE_DIAGNOSTIC_BUFFR_PROVIDER_H
21 #define STEAM_ENGINE_DIAGNOSTIC_BUFFR_PROVIDER_H
22 
23 
24 #include "lib/error.hpp"
25 #include "lib/depend.hpp"
26 #include "lib/util.hpp"
29 #include "lib/nocopy.hpp"
30 
31 #include <memory>
32 
33 
34 namespace steam {
35 namespace engine {
36 
37  namespace error = lumiera::error;
38 
39 
44  class TrackingHeapBlockProvider;
45 
46 
47  /****************************************************************/
54  {
55 
56  std::unique_ptr<TrackingHeapBlockProvider> pImpl_;
58 
59 
61  bool isCurrent (BufferProvider const&);
62 
63 
66 
68 
69  public:
73  static BufferProvider& build();
74 
75 
81  access (BufferProvider const& );
82 
83 
84 
85 
86  /* === diagnostic API === */
87 
88  bool buffer_was_used (uint bufferID) const;
89  bool buffer_was_closed (uint bufferID) const;
90  void* accessMemory (uint bufferID) const;
91  bool all_buffers_released() const;
92 
93 
94 
95  private:
96 
97  };
98 
99 
100 
101 }} // namespace steam::engine
102 #endif
Helper for unit tests: Buffer provider reference implementation.
static lib::Depend< DiagnosticBufferProvider > diagnostics
Storage for the diagnostics frontend.
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
static DiagnosticBufferProvider & access(BufferProvider const &)
access the diagnostic API of the buffer provider
Steam-Layer implementation namespace root.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:280
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.
simple BufferProvider implementation with additional allocation tracking.
Lumiera error handling (C++ interface).
static BufferProvider & build()
build a new Diagnostic Buffer Provider instance, discard the existing one.
Helper to abstract creation and lifecycle of a dependency.
Definition: depend.hpp:125
Interface: a facility providing and managing working buffers for media calculations.
Abstraction to represent buffer management and lifecycle within the render engine.