From ed95e01cf3e2da2e4566702484545179c03fe597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Thu, 5 Oct 2023 11:48:10 +0200 Subject: [PATCH] implement events --- src/simplified/xf/core/customevent.cpp | 14 +++++++++++++- src/simplified/xf/core/defaulttransition.cpp | 11 ++++++++++- src/simplified/xf/core/initialevent.cpp | 11 ++++++++++- src/simplified/xf/core/timeout.cpp | 1 + 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/simplified/xf/core/customevent.cpp b/src/simplified/xf/core/customevent.cpp index 7580c78..f15e9e5 100644 --- a/src/simplified/xf/core/customevent.cpp +++ b/src/simplified/xf/core/customevent.cpp @@ -1,3 +1,15 @@ #include "xf/customevent.h" -// TODO: Implement code for XFCustomEvent class +// TODO done: Implement code for XFCustomEvent class + + +XFCustomEvent::XFCustomEvent(int id, interface::XFBehavior *pBehavior): + XFEvent(XFEventType::Unknown, id){ + setBehavior(pBehavior); +} + +bool XFCustomEvent::deleteAfterConsume() const { + return bDeleteAfterConsume_; +} + + diff --git a/src/simplified/xf/core/defaulttransition.cpp b/src/simplified/xf/core/defaulttransition.cpp index 99d335b..e08e854 100644 --- a/src/simplified/xf/core/defaulttransition.cpp +++ b/src/simplified/xf/core/defaulttransition.cpp @@ -1,3 +1,12 @@ #include "xf/defaulttransition.h" -// TODO: Implement code for XFDefaultTransition class +// TODO done: Implement code for XFDefaultTransition class + +XFDefaultTransition::XFDefaultTransition(): + XFEvent(XFEventType::DefaultTransition) { + +} + +bool XFDefaultTransition::deleteAfterConsume() const { + return true; +} diff --git a/src/simplified/xf/core/initialevent.cpp b/src/simplified/xf/core/initialevent.cpp index b761b39..d7f343b 100644 --- a/src/simplified/xf/core/initialevent.cpp +++ b/src/simplified/xf/core/initialevent.cpp @@ -1,3 +1,12 @@ #include "xf/initialevent.h" -// TODO: Implement code for XFInitialEvent class +// TODO done: Implement code for XFInitialEvent class + +XFInitialEvent::XFInitialEvent(): + XFEvent(XFEventType::Initial) { + +} + +bool XFInitialEvent::deleteAfterConsume() const { + return true; +} diff --git a/src/simplified/xf/core/timeout.cpp b/src/simplified/xf/core/timeout.cpp index 2f2202f..717bad5 100644 --- a/src/simplified/xf/core/timeout.cpp +++ b/src/simplified/xf/core/timeout.cpp @@ -4,6 +4,7 @@ XFTimeout::XFTimeout(int id, int interval, interface::XFBehavior *pBehavior): XFEvent(XFEventType::Timeout, id), interval_(interval) { + setBehavior(pBehavior); } bool XFTimeout::operator ==(const XFTimeout &timeout) const {