Skip to content

Commit

Permalink
Fix comments and reactor
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Oct 26, 2024
1 parent bbeef30 commit 23b98f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/Reactor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ namespace dsl {

struct MainThread;

template <typename T>
struct TaskScope;

template <typename>
struct Network;

Expand Down Expand Up @@ -225,6 +228,10 @@ class Reactor {
/// @copydoc dsl::word::MainThread
using MainThread = dsl::word::MainThread;

/// @copydoc dsl::word::TaskScope
template <typename T>
using TaskScope = dsl::word::TaskScope<T>;

/// @copydoc dsl::word::Startup
using Startup = dsl::word::Startup;

Expand Down Expand Up @@ -474,6 +481,7 @@ class Reactor {
#include "dsl/word/Startup.hpp"
#include "dsl/word/Sync.hpp"
#include "dsl/word/TCP.hpp"
#include "dsl/word/TaskScope.hpp"
#include "dsl/word/Trigger.hpp"
#include "dsl/word/UDP.hpp"
#include "dsl/word/Watchdog.hpp"
Expand Down
7 changes: 3 additions & 4 deletions src/dsl/word/TaskScope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ namespace dsl {
*
* For example, if you want to have a DSL word that modifies how events are emitted within that task you can use
* this to track when the current task is one with that word.
* It utilises pre_run and post_run to track when the task is running by storing the task id in a thread local
* variable.
* Then when another system needs to know if it is running in that context it can call the is_running function.
* It utilises scope to track when the task is running by storing the task id in a thread local variable.
* Then when another system needs to know if it is running in that context it can call the in_scope function.
*
* @tparam Group a unique type to identify this group of tasks
* @tparam Group a unique type to identify this scope
*/
template <typename Group>
struct TaskScope {
Expand Down

0 comments on commit 23b98f1

Please sign in to comment.