From 568fadd5265edb366e626cdaa04965ae98ff9652 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 9 Feb 2012 22:24:05 +0100 Subject: [PATCH] draft some steps of the dispatch operation --- src/proc/engine/dispatcher.hpp | 6 +++++- src/proc/engine/frame-coord.hpp | 15 ++++++++++++-- src/proc/engine/time-anchor.hpp | 20 +++++++++++++++---- .../proc/engine/dispatcher-interface-test.cpp | 15 +++++++++++++- 4 files changed, 48 insertions(+), 8 deletions(-) diff --git a/src/proc/engine/dispatcher.hpp b/src/proc/engine/dispatcher.hpp index 90265c5b4..c828ea260 100644 --- a/src/proc/engine/dispatcher.hpp +++ b/src/proc/engine/dispatcher.hpp @@ -25,7 +25,9 @@ #define PROC_ENGINE_DISPATCHER_H #include "proc/common.hpp" -#include "proc/state.hpp" +//#include "proc/state.hpp" +#include "proc/engine/time-anchor.hpp" +#include "proc/engine/frame-coord.hpp" #include "lib/time/timevalue.hpp" #include @@ -52,6 +54,8 @@ namespace engine { virtual ~Dispatcher(); ///< this is an interface + virtual FrameCoord locateFrameNext (uint frameCountOffset) =0; + }; diff --git a/src/proc/engine/frame-coord.hpp b/src/proc/engine/frame-coord.hpp index 6ff385790..950874927 100644 --- a/src/proc/engine/frame-coord.hpp +++ b/src/proc/engine/frame-coord.hpp @@ -34,8 +34,9 @@ namespace proc { namespace engine { - using lib::time::TimeSpan; - using lib::time::FSecs; +//using lib::time::TimeSpan; + using lib::time::Duration; +//using lib::time::FSecs; using lib::time::Time; // // class ExitNode; @@ -58,6 +59,9 @@ namespace engine { { public: + Time absoluteNominalTime; + int64_t absoluteFrameNumber; + FrameCoord() { UNIMPLEMENTED ("anything regarding the Node Invocation"); @@ -65,6 +69,13 @@ namespace engine { // using default copy operations + + Duration remainingRealTime() + { + UNIMPLEMENTED ("deterine the real wall clock time amount left until deadline"); + } + + }; diff --git a/src/proc/engine/time-anchor.hpp b/src/proc/engine/time-anchor.hpp index 4f8c62b16..ad6736252 100644 --- a/src/proc/engine/time-anchor.hpp +++ b/src/proc/engine/time-anchor.hpp @@ -27,15 +27,16 @@ #include "proc/common.hpp" //#include "proc/state.hpp" #include "lib/time/timevalue.hpp" +#include "proc/play/timings.hpp" namespace proc { namespace engine { - using lib::time::TimeSpan; - using lib::time::FSecs; - using lib::time::Time; +// using lib::time::TimeSpan; +// using lib::time::FSecs; +// using lib::time::Time; // // class ExitNode; @@ -57,13 +58,24 @@ namespace engine { class TimeAnchor { - public: TimeAnchor() { UNIMPLEMENTED ("anything regarding the Engine backbone"); } + public: // using default copy operations + + static TimeAnchor + build (play::Timings timings, uint64_t startFrame) + { + UNIMPLEMENTED ("representation of the Time Anchor closure"); + } + + operator lib::time::TimeValue() const + { + UNIMPLEMENTED ("representation of the Time Anchor closure"); + } }; diff --git a/tests/components/proc/engine/dispatcher-interface-test.cpp b/tests/components/proc/engine/dispatcher-interface-test.cpp index 6a05f27e0..b30a0293f 100644 --- a/tests/components/proc/engine/dispatcher-interface-test.cpp +++ b/tests/components/proc/engine/dispatcher-interface-test.cpp @@ -45,6 +45,7 @@ namespace test { using lib::time::QuTime; using lib::time::FrameRate; + using lib::time::Duration; using proc::play::Timings; namespace { // used internally @@ -54,6 +55,12 @@ namespace test { : public Dispatcher { + FrameCoord + locateFrameNext (uint frameCountOffset) + { + UNIMPLEMENTED ("dummy implementation of the core dispatch operation"); + } + public: }; @@ -92,11 +99,17 @@ namespace test { verify_basicDispatch() { Dispatcher& dispatcher = mockDispatcher(); -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 Timings timings (FrameRate::PAL); uint startFrame(10); TimeAnchor refPoint = TimeAnchor::build (timings, startFrame); + CHECK (refPoint == Time::ZERO + Duration(10, FrameRate::PAL)); + + FrameCoord coordinates = dispatcher.locateFrameNext (15); + CHECK (coordinates.absoluteNominalTime == Time(0,1)); + CHECK (coordinates.absoluteFrameNumber == 25); + CHECK (coordinates.remainingRealTime() >= Time(FSecs(24,25))); +#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 }