Compare commits

..

No commits in common. "79aab9999ff9256b71c86275b275ce2269ba1c29" and "922c58d611fe42b0a3c6634b2600b9e724d64cd4" have entirely different histories.

5 changed files with 10 additions and 166 deletions

56
.gitignore vendored
View File

@ -1,55 +1 @@
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.so.*
*.dll
*.dylib
# Qt-es
object_script.*.Release
object_script.*.Debug
*_plugin_import.cpp
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
*.qmlc
*.jsc
Makefile*
*build-*
*.qm
*.prl
# Qt unit tests
target_wrapper.*
# QtCreator
*.autosave
# QtCreator Qml
*.qmlproject.user
*.qmlproject.user.*
# QtCreator CMake
CMakeLists.txt.user*
# QtCreator 4.8< compilation database
compile_commands.json
# QtCreator local machine specific files for imported projects
*creator.user*
*_qmlcache.qrc
*.user
test-bench/test1/build-test1-idf-Desktop_Qt_6_3_0_MinGW_64_bit-Debug

View File

@ -3,48 +3,4 @@
#include "xf/initialevent.h"
#include "xf/behavior.h"
// TODO: Implement code for XFBehavior class
XFBehavior::XFBehavior() {
}
XFBehavior::~XFBehavior() {
}
void XFBehavior::startBehavior() {
}
void XFBehavior::pushEvent(XFEvent *pEvent) {
}
bool XFBehavior::deleteOnTerminate() const {
return deleteOnTerminate_;
}
void XFBehavior::setDeleteOnTerminate(bool deleteBehaviour) {
deleteOnTerminate_ = deleteBehaviour;
}
const XFEvent *XFBehavior::getCurrentEvent() const {
return pCurrentEvent_;
}
interface::XFDispatcher *XFBehavior::getDispatcher() {
}
const XFTimeout *XFBehavior::getCurrentTimeout() {
}
void XFBehavior::setCurrentEvent(const XFEvent *pEvent) {
}
XFBehavior::TerminateBehavior XFBehavior::process(const XFEvent *pEvent) {
}
// TODO: Implement code for XFBehavior class

View File

@ -1,17 +1,9 @@
#include "xf/timeout.h"
// TODO done: Implement code for XFTimeout class
// TODO: Implement code for XFTimeout class
XFTimeout::XFTimeout(int id, int interval, interface::XFBehavior *pBehavior):
XFEvent(XFEventType::Timeout, id), interval_(interval) {
}
bool XFTimeout::operator ==(const XFTimeout &timeout) const {
bool i = (id_ == timeout.id_);
bool b = (pBehavior_ == timeout.pBehavior_);
return (i && b);
}
bool XFTimeout::deleteAfterConsume() const {
return true;
}

View File

@ -19,46 +19,12 @@ using Mutex = interface::XFMutex; // Rename XFMutex interface class to Mut
// Note: The implementation is done here because only in this file the real XFDispatcher
// class is known (port specific class). An instance of the XFDispatcher class is
// returned by the 'interface::XFDispatcher' class.
interface::XFDispatcher * interface::XFDispatcher::getInstance() {
interface::XFDispatcher * interface::XFDispatcher::getInstance()
{
static ::XFDispatcher dispatcher;
return &dispatcher;
}
// TODO: Implement code for XFDispatcher class
XFDispatcher::XFDispatcher() {
}
XFDispatcher::~XFDispatcher() {
}
void XFDispatcher::dispatchEvent(const XFEvent *pEvent) const {
}
void XFDispatcher::pushEvent(XFEvent *pEvent) {
events_.push(pEvent);
}
void XFDispatcher::scheduleTimeout(int timeoutId, int interval, interface::XFBehavior *pBehavior) {
XFTimeoutManager* timeoutManager = XFTimeoutManager::getInstance();
timeoutManager->scheduleTimeout(timeoutId, interval, pBehavior);
}
void XFDispatcher::unscheduleTimeout(int timeoutId, interface::XFBehavior *pBehavior) {
XFTimeoutManager* timeoutManager = XFTimeoutManager::getInstance();
timeoutManager->unscheduleTimeout(timeoutId, pBehavior);
}
void XFDispatcher::executeOnce() {
}
int XFDispatcher::execute(const void *param) {
}
#endif // USE_XF_COMMON_DISPATCHER_CLASS

View File

@ -23,14 +23,7 @@ interface::XFTimeoutManager * interface::XFTimeoutManager::getInstance() {
// TODO: Implement code for XFTimeoutManager class
XFTimeoutManager::XFTimeoutManager() {
}
void XFTimeoutManager::addTimeout(XFTimeout *pNewTimeout) {
timeouts_.push_front(pNewTimeout);
}
void XFTimeoutManager::returnTimeout(XFTimeout *pTimeout) {
timeouts_.remove(pTimeout);
}
XFTimeoutManager::~XFTimeoutManager() {
@ -43,23 +36,14 @@ void XFTimeoutManager::start(std::function<void (uint32_t)> startTimeoutManagerT
void XFTimeoutManager::scheduleTimeout(int32_t timeoutId, int32_t interval, interface::XFBehavior *pBehavior) {
::XFTimeout* timeout = new XFTimeout(timeoutId, interval, pBehavior);
addTimeout(timeout);
timeouts_.push_front(timeout);
}
int32_t timeoutIdComparison;
bool myPredicate(XFTimeout* timeout) {return (timeout->getId()==timeoutIdComparison);}
void XFTimeoutManager::unscheduleTimeout(int32_t timeoutId, interface::XFBehavior *pBehavior) {
for(XFTimeout* timeout : timeouts_) {
bool id = ( timeout->getId() == timeoutId );
bool behavior = ( timeout->getBehavior() == pBehavior);
if( id && behavior ) {
timeouts_.remove(timeout);
}
}
}
void XFTimeoutManager::tick() {
for(XFTimeout* timeout : timeouts_) {
timeout->substractFromRelTicks(tickInterval_);
}
timeoutIdComparison = timeoutId;
timeouts_.remove_if(myPredicate);
}
#endif // USE_XF_COMMON_TIMEOUTMANAGER_CLASS