Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
diagnostic-buffer-provider.cpp
Go to the documentation of this file.
1/*
2 DiagnosticBufferProvider - 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
14
23#include "lib/error.hpp"
24#include "lib/meta/function.hpp"
25
28
29
30namespace steam {
31namespace engine {
32
33
36
37
38
39
43
45
46
49 {
50 return diagnostics().reset();
51 }
52
53
56 {
57 if (!diagnostics().isCurrent (provider))
58 throw error::Invalid("given Provider doesn't match (current) diagnostic data record."
59 "This might be an lifecycle error. Did you build() this instance beforehand?");
60
61 return diagnostics();
62 }
63
64
65
66
75
76 bool
78 {
79 return &implInstance == pImpl_.get();
80 }
81
82
83
84
85
86 /* === diagnostic API === */
87
88 bool
90 {
91 return pImpl_->access_emitted(bufferID).was_used();
92 }
93
94
95 bool
97 {
98 return pImpl_->access_emitted(bufferID).was_closed();
99 }
100
101
102 void*
104 {
105 return pImpl_->access_emitted(bufferID).accessMemory();
106 }
107
108
109}} // namespace engine
Access point to singletons and other kinds of dependencies designated by type.
Definition depend.hpp:281
Interface: a facility providing and managing working buffers for media calculations.
Helper for unit tests: Buffer provider reference implementation.
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.
std::unique_ptr< TrackingHeapBlockProvider > pImpl_
simple BufferProvider implementation with additional allocation tracking.
A facility for writing unit-tests targeting the BufferProvider interface.
Lumiera error handling (C++ interface).
Metaprogramming tools for detecting and transforming function types.
unsigned int uint
Definition integral.hpp:29
LumieraError< LERR_(INVALID)> Invalid
Definition error.hpp:211
Steam-Layer implementation namespace root.
Dummy implementation of the BufferProvider interface to support writing unit tests.