diff --git a/sources/3rdparty/task/README.md b/sources/3rdparty/task/README.md new file mode 100644 index 0000000..c375afb --- /dev/null +++ b/sources/3rdparty/task/README.md @@ -0,0 +1,41 @@ + + +Asynchronous programming in Qt/C++ using tasks,continuations and resumable functions. + +This project is inspired by this[1] video on channel9. + +The project seeks to do async based programming in Qt/C++ using modern C++ with lambdas. + +The project has two sets of APIs. + +1. Task::run().then() API provides async based programming with continuation[4]. + +2. Task::await() API provides the first API presented in a different way[5]. + +Under certain use cases,they can be used interchangeably, and in others,only one or the other can be used.Some of the problems +the first API causes and solved by the second API are discussed in this[7] youtube video. + +Example use case for the Task::run().then() API can be found here[0]. Additional example is [2] where an API is +declared and [3] where the declared API is used. + +Example use case of the Task::await() API is here[6] where a function call "blocks" waiting for a result without "hanging" the entire GUI application. + +A short tutorial on task/async/await as implemented in C# can be viewed from this[8] link. + +[0] https://github.com/mhogomchungu/tasks/blob/master/example.cpp + +[1] http://channel9.msdn.com/Blogs/Charles/Asynchronous-Programming-for-C-Developers-PPL-Tasks-and-Windows-8 + +[2] https://github.com/mhogomchungu/zuluCrypt/blob/d0439a4e36521e42fa9392b82dcefd3224d53334/zuluMount-gui/zulumounttask.h#L61 + +[3] https://github.com/mhogomchungu/zuluCrypt/blob/d0439a4e36521e42fa9392b82dcefd3224d53334/zuluMount-gui/mainwindow.cpp#L812 + +[4] Disscussion about this can be found on the following link among other places: http://isocpp.org/files/papers/N3558.pdf + +[5] Disscussion about this can be found on the following link among other places: http://isocpp.org/files/papers/N3564.pdf + +[6] https://github.com/mhogomchungu/zuluCrypt/blob/7123e3c3a7c8c5b3b3b6958464fd92a7f780d827/zuluMount-gui/keydialog.cpp#L511 + +[7] https://www.youtube.com/watch?v=Y475RshtAHA + +[8] http://www.youtube.com/watch?v=DqjIQiZ_ql4 diff --git a/sources/task.h b/sources/3rdparty/task/task.h similarity index 100% rename from sources/task.h rename to sources/3rdparty/task/task.h diff --git a/sources/dataengine/CMakeLists.txt b/sources/dataengine/CMakeLists.txt index 260ba99..a92a70c 100644 --- a/sources/dataengine/CMakeLists.txt +++ b/sources/dataengine/CMakeLists.txt @@ -13,7 +13,7 @@ set (PLUGIN_NAME ${SUBPROJECT}) file (GLOB SUBPROJECT_DESKTOP_IN *.desktop) file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN}) file (GLOB SUBPROJECT_SOURCE *.cpp) -set (TASK_HEADER ${CMAKE_SOURCE_DIR}/task.h) +set (TASK_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/task.h) file (GLOB SUBPROJECT_CONF *.conf) # prepare diff --git a/sources/dataengine/task.h b/sources/dataengine/task.h new file mode 120000 index 0000000..254b484 --- /dev/null +++ b/sources/dataengine/task.h @@ -0,0 +1 @@ +../3rdparty/task/task.h \ No newline at end of file diff --git a/sources/netctlgui/doxygen.conf.in b/sources/netctlgui/doxygen.conf.in index 8dafdef..8b7fba0 100644 --- a/sources/netctlgui/doxygen.conf.in +++ b/sources/netctlgui/doxygen.conf.in @@ -764,7 +764,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_CURRENT_SOURCE_DIR@ +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/include/netctlgui # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/sources/netctlgui/src/CMakeLists.txt b/sources/netctlgui/src/CMakeLists.txt index a4ebf81..51ff6a1 100644 --- a/sources/netctlgui/src/CMakeLists.txt +++ b/sources/netctlgui/src/CMakeLists.txt @@ -1,7 +1,7 @@ # set files file (GLOB SOURCES *.cpp) -file (GLOB HEADERS ${SUBPROJECT_INCLUDE_DIR}/${SUBPROJECT}/*.h) -set (HEADERS ${HEADERS} ${CMAKE_SOURCE_DIR}/task.h) +file (GLOB HEADERS *.h) +# set (HEADERS ${HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/task.h) # include_path include_directories (${SUBPROJECT_INCLUDE_DIR} diff --git a/sources/netctlgui/src/netctlgui.h b/sources/netctlgui/src/netctlgui.h new file mode 120000 index 0000000..39334b9 --- /dev/null +++ b/sources/netctlgui/src/netctlgui.h @@ -0,0 +1 @@ +../include/netctlgui/netctlgui.h \ No newline at end of file diff --git a/sources/netctlgui/src/netctlinteract.cpp b/sources/netctlgui/src/netctlinteract.cpp index 1510bad..ff8ba18 100644 --- a/sources/netctlgui/src/netctlinteract.cpp +++ b/sources/netctlgui/src/netctlinteract.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include "netctlgui.h" #include "task.h" diff --git a/sources/netctlgui/src/netctlinteract.h b/sources/netctlgui/src/netctlinteract.h new file mode 120000 index 0000000..eee7a8a --- /dev/null +++ b/sources/netctlgui/src/netctlinteract.h @@ -0,0 +1 @@ +../include/netctlgui/netctlinteract.h \ No newline at end of file diff --git a/sources/netctlgui/src/netctlprofile.cpp b/sources/netctlgui/src/netctlprofile.cpp index dd2fd3b..0fc314d 100644 --- a/sources/netctlgui/src/netctlprofile.cpp +++ b/sources/netctlgui/src/netctlprofile.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include "netctlgui.h" /** diff --git a/sources/netctlgui/src/netctlprofile.h b/sources/netctlgui/src/netctlprofile.h new file mode 120000 index 0000000..9934b85 --- /dev/null +++ b/sources/netctlgui/src/netctlprofile.h @@ -0,0 +1 @@ +../include/netctlgui/netctlprofile.h \ No newline at end of file diff --git a/sources/netctlgui/src/sleepthread.h b/sources/netctlgui/src/sleepthread.h new file mode 120000 index 0000000..b5a7b6f --- /dev/null +++ b/sources/netctlgui/src/sleepthread.h @@ -0,0 +1 @@ +../include/netctlgui/sleepthread.h \ No newline at end of file diff --git a/sources/netctlgui/src/task.h b/sources/netctlgui/src/task.h new file mode 120000 index 0000000..5da0bbd --- /dev/null +++ b/sources/netctlgui/src/task.h @@ -0,0 +1 @@ +../../3rdparty/task/task.h \ No newline at end of file diff --git a/sources/netctlgui/src/wpasupinteract.cpp b/sources/netctlgui/src/wpasupinteract.cpp index 457dd04..0233c69 100644 --- a/sources/netctlgui/src/wpasupinteract.cpp +++ b/sources/netctlgui/src/wpasupinteract.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include "netctlgui.h" /** diff --git a/sources/netctlgui/src/wpasupinteract.h b/sources/netctlgui/src/wpasupinteract.h new file mode 120000 index 0000000..b052f5c --- /dev/null +++ b/sources/netctlgui/src/wpasupinteract.h @@ -0,0 +1 @@ +../include/netctlgui/wpasupinteract.h \ No newline at end of file