diff --git a/src/proc/engine/buffer-metadata.hpp b/src/proc/engine/buffer-metadata.hpp index 13cc9432b..c71359313 100644 --- a/src/proc/engine/buffer-metadata.hpp +++ b/src/proc/engine/buffer-metadata.hpp @@ -106,8 +106,10 @@ namespace engine { public: struct Entry { - BufferState state () const; + BufferState state() const; + HashVal parentKey() const; Entry& mark (BufferState newState); + Entry& markLocked (const void* buffer); }; @@ -122,12 +124,42 @@ namespace engine { UNIMPLEMENTED ("combine the distinguishing properties into a single hash"); } + HashVal + key (HashVal parentKey, TypeHandler instanceFunc) + { + UNIMPLEMENTED ("create sub-type key"); + } + + HashVal + key (HashVal parentKey, LocalKey specifics) + { + UNIMPLEMENTED ("create sub-type key"); + } + + HashVal + key (HashVal parentKey, const void* concreteBuffer) + { + UNIMPLEMENTED ("create sub-object key for concrete buffer"); + } + Entry& get (HashVal key) { UNIMPLEMENTED ("access, possibly create metadata records"); } + bool + isKnown (HashVal key) const + { + UNIMPLEMENTED ("diagnostics: known record?"); + } + + bool + isLocked (HashVal key) const + { + UNIMPLEMENTED ("diagnostics: actually locked buffer instance record?"); + } + #if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #834 #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #834 }; @@ -144,6 +176,13 @@ namespace engine { UNIMPLEMENTED ("buffer state accounting"); } + /** */ + HashVal + Metadata::Entry::parentKey () const + { + UNIMPLEMENTED ("retrieve the sparent (object or type) key"); + } + Metadata::Entry& Metadata::Entry::mark (BufferState newState) { @@ -151,6 +190,12 @@ namespace engine { return *this; } + Metadata::Entry& + Metadata::Entry::markLocked (const void* buffer) + { + UNIMPLEMENTED ("transition to locked state"); + return *this; + } diff --git a/tests/46engine.tests b/tests/46engine.tests index 2c9df05db..e1a3f9704 100644 --- a/tests/46engine.tests +++ b/tests/46engine.tests @@ -2,16 +2,16 @@ TESTING "Component Test Suite: Render Engine parts" ./test-components --group=en -PLANNED "BufferProviderProtocol_test" Buffer provider diagnostics <get(key); CHECK (NIL == m1.state()); + CHECK (!meta_->isLocked(key)); VERIFY_ERROR (LIFECYCLE, m1.mark(EMITTED) ); + VERIFY_ERROR (LIFECYCLE, m1.mark(LOCKED) ); - m1.mark (LOCKED); - CHECK (LOCKED == m1.state()); - CHECK (LOCKED == meta_->get(key1).state()); + Metadata::Entry& m2 = m1.markLocked (SOME_POINTER); + CHECK (!isSameObject (m1,m2)); + CHECK (NIL == m1.state()); + CHECK (LOCKED == m2.state()); + + HashVal keyX = meta_->key(key1, SOME_POINTER); + CHECK (meta_->isLocked(keyX)); + CHECK (keyX != key1); + CHECK (keyX); + + CHECK ( isSameObject (m1, meta_->get(key))); + CHECK ( isSameObject (m1, meta_->get(key1))); + CHECK ( isSameObject (m2, meta_->get(keyX))); + CHECK ( key1 == m2.parentKey()); + + m2.mark(FREE); // Warning: don't use the m2 reference anymore! + CHECK (!meta_->isLocked(keyX)); + CHECK (!meta_->isKnown(keyX)); + CHECK ( meta_->isKnown(key1)); + VERIFY_ERROR (INVALID, meta_->get(keyX)); }