diff --git a/src/proc/engine/buffer-provider.cpp b/src/proc/engine/buffer-provider.cpp index c9a2311e8..0ca617577 100644 --- a/src/proc/engine/buffer-provider.cpp +++ b/src/proc/engine/buffer-provider.cpp @@ -63,6 +63,13 @@ namespace engine { return provider_->verifyValidity(*this); } + + void + BuffHandle::release() + { + UNIMPLEMENTED ("forward buffer release call to buffer provider"); + } + } // namespace engine diff --git a/src/proc/engine/buffhandle.hpp b/src/proc/engine/buffhandle.hpp index 889638724..8401bdb17 100644 --- a/src/proc/engine/buffhandle.hpp +++ b/src/proc/engine/buffhandle.hpp @@ -132,9 +132,16 @@ namespace engine { // using standard copy operations + + void release(); + + template BU& create(); + template + BU& accessAs(); + Buff& operator* () const @@ -175,6 +182,18 @@ namespace engine { } + /** convenience shortcuts: access the buffer contents in a typesafe fashion. + * This is equivalent to a plain dereferentiation with additional metadata check + * @throw error::Logic in case of type mismatch \c LUMIERA_ERROR_WRONG_TYPE + */ + template + BU& + BuffHandle::accessAs() + { + UNIMPLEMENTED ("convenience shortcut to access buffer contents typesafe"); + } + + } // namespace engine #endif diff --git a/src/proc/engine/diagnostic-buffer-provider.hpp b/src/proc/engine/diagnostic-buffer-provider.hpp index 42011673a..c8836b617 100644 --- a/src/proc/engine/diagnostic-buffer-provider.hpp +++ b/src/proc/engine/diagnostic-buffer-provider.hpp @@ -47,6 +47,23 @@ namespace engine { class DiagnosticBufferProvider : public BufferProvider { + + + /* === BufferProvider Implementation === */ + + virtual BuffHandle + lockBufferFor (BufferDescriptor const& descriptor) + { + UNIMPLEMENTED ("lock buffer for exclusive use"); + } + + virtual void + releaseBuffer (BuffHandle const& handle) + { + UNIMPLEMENTED ("release a buffer and invalidate the handle"); + } + + public: /** build a new Diagnostic Buffer Provider instance, * discard the existing one. Use the static query API @@ -57,6 +74,60 @@ namespace engine { UNIMPLEMENTED ("Diagnostic Buffer Provider instance"); } + + /** access the diagnostic API of the buffer provider + * @throw error::Invalid if the given provider doesn't allow + * for diagnostic access or wasn't registered beforehand. + */ + static DiagnosticBufferProvider& + access (BufferProvider const& provider) + { + UNIMPLEMENTED ("access existing instance linked to the given provider"); + } + + + + + /* === diagnostic API === */ + + bool + buffer_was_used (uint bufferID) + { + UNIMPLEMENTED ("check usage flag of a specific buffer"); + } + + + bool + buffer_was_closed (uint bufferID) + { + UNIMPLEMENTED ("check closed-flag of a specific buffer"); + } + + + template + bool + object_was_attached (uint bufferID) + { + UNIMPLEMENTED ("verify object attachment status of a specific buffer"); + } + + + template + bool + object_was_destroyed (uint bufferID) + { + UNIMPLEMENTED ("verify object attachment status of a specific buffer"); + } + + + void* + accessStorage (uint bufferID) + { + + } + + + private: }; diff --git a/tests/components/proc/engine/buffer-provider-protocol-test.cpp b/tests/components/proc/engine/buffer-provider-protocol-test.cpp index 38f65568d..7846dec5a 100644 --- a/tests/components/proc/engine/buffer-provider-protocol-test.cpp +++ b/tests/components/proc/engine/buffer-provider-protocol-test.cpp @@ -88,22 +88,20 @@ namespace test { CHECK (sizeof(TestFrame) <= buff.size()); buff.create() = testData(0); -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #829 - TestFrame* storage = *buff; - CHECK (testData(0) == *storage); + TestFrame& storage = buff.accessAs(); + CHECK (testData(0) == storage); buff.release(); CHECK (!buff.isValid()); - VERIFY_ERROR (LIFECYCLE, *buff ); + VERIFY_ERROR (LIFECYCLE, buff.accessAs() ); - DiagnosticBufferProvider checker = DiagnosticBufferProvider::access(provider); + DiagnosticBufferProvider& checker = DiagnosticBufferProvider::access(provider); CHECK (checker.buffer_was_used (0)); CHECK (checker.buffer_was_closed (0)); - CHECK (checker.object_was_attached ()); - CHECK (checker.object_was_destroyed ()); + CHECK (checker.object_was_attached (0)); + CHECK (checker.object_was_destroyed (0)); CHECK (testData(0) == checker.accessStorage (0)); -#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #829 } diff --git a/tests/components/proc/engine/testframe.hpp b/tests/components/proc/engine/testframe.hpp index 0ea6a8d75..5678bf147 100644 --- a/tests/components/proc/engine/testframe.hpp +++ b/tests/components/proc/engine/testframe.hpp @@ -55,6 +55,24 @@ namespace test { { public: + + bool + operator== (void* memLocation) + { + UNIMPLEMENTED ("verify contents of an arbitrary memory location"); + } + + friend bool + operator== (TestFrame const& f1, TestFrame const& f2) + { + UNIMPLEMENTED ("equality of test data frames"); + } + + friend bool + operator!= (TestFrame const& f1, TestFrame const& f2) + { + return !(f1 == f2); + } };