diff --git a/UML/event.png b/UML/event.png new file mode 100644 index 0000000..d5f2455 Binary files /dev/null and b/UML/event.png differ diff --git a/UML/event.puml b/UML/event.puml new file mode 100644 index 0000000..3c5e275 --- /dev/null +++ b/UML/event.puml @@ -0,0 +1,55 @@ +@startuml + +participant Behavior as b +participant Dispatcher as d +entity Event as e +participant EventQueue as eq +queue "EventQueue::queue_" as q + +== Create an Event == +||| +?->> b ++ : GEN +b -> e ** : new +b -> b --++ : pushEvent +e -> b : getBehavior +b --> e ++: setBehavior +e --> b -- +b -> d ++ : getDispatcher +d --> b +b -> d -- : pushEvent +d ->? -- : push + + +||| +||| +== Push Event == +||| +?->> d ++: pushEvent +d -> eq--++: push +eq -> q ++ +q --> eq +eq -> q -- : pushEndQueue + +||| +||| +== Dispatch == +||| +?->> d ++: executeOnce +d -> q : getFront +q -> e ++ +e --> q +q --> d : event +d -> q : pop +deactivate q +d -> d --++ : dispatchEvent +d -> b ++ : getBehavior +b --> d +d -> b -- : process +b -> b--: processEvent + +destroy e + + + + +@enduml \ No newline at end of file diff --git a/readme.md b/readme.md index c6745ec..51b511c 100644 --- a/readme.md +++ b/readme.md @@ -8,40 +8,6 @@ # Time Algorithm -
- Code puml (maybe it's displayed) - -```plantuml -@startuml - -start -:newTime = 0 -totalTime = 0 -isEnd = it == list.end() -lastTime = 0; - -#tomato:if (!isEnd) then (not end) - #tomato:totalTime += it.getRelTicks(); -endif - - while ( !isEnd && (totalTime <= newTime) ) is (goForward) - :isEnd = (++it == list.end()); - :lastTime = totalTime; - #tomato:if (!isEnd) then (not end) - #tomato:totalTime += it.getRelTicks(); - endif - endwhile - -#tomato:if (!isEnd) then (not end) - #tomato:subRelTicks(newTime- lastTime); -endif -:it.setRelTicks(newTime - lastTime); -:insert(it, newTimeout); - -@enduml -``` - -
@@ -50,6 +16,10 @@ endif +## Event + + + # Tests ## Test 1 This test launches an instance of the Task01Tm class and produces some output. Optionally, multiple instances of Task01Tm can be created to test the XF.