Skip to content

Commit

Permalink
Change in docs too
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Aug 9, 2024
1 parent 4e2d782 commit 6b38694
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions docs/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Bind

.. codeblock:: c++
template <typename DSL>
static inline void bind(const std::shared_ptr<threading::Reaction>& reaction, /*More arguments can be declared*/)
static void bind(const std::shared_ptr<threading::Reaction>& reaction, /*More arguments can be declared*/)

This function is called when the reaction is bound, it should be thought of as the constructor. It is used to setup
anything that is required by the DSL word.
Expand All @@ -68,7 +68,7 @@ Get

.. codeblock:: c++
template <typename DSL>
static inline T get(threading::ReactionTask& task)
static T get(threading::ReactionTask& task)

This is used to get the data for the callback. The returned value is passed to the callback.

Expand All @@ -84,7 +84,7 @@ Precondition

.. codeblock:: c++
template <typename DSL>
static inline bool precondition(threading::ReactionTask& task)
static bool precondition(threading::ReactionTask& task)

A precondition is used to test if the reaction should run. On a true return the reaction will run as normal. On a false
return the reaction will be dropped.
Expand All @@ -103,7 +103,7 @@ Reschedule

.. codeblock:: c++
template <typename DSL>
static inline std::unique_ptr<threading::ReactionTask> reschedule(std::unique_ptr<threading::ReactionTask>&& task)
static std::unique_ptr<threading::ReactionTask> reschedule(std::unique_ptr<threading::ReactionTask>&& task)

The ownership of the reaction task is passed to the DSL word. The task returned will be run instead of the passed in
reaction task. If the returned task is the one passed in the task will be run normally.
Expand Down Expand Up @@ -167,7 +167,7 @@ Now we define the `reschedule` to interrupt any new tasks if we are currently ru
multithreaded so a mutex is needed when accessing the static members.
.. codeblock:: c++
template <typename DSL>
static inline std::unique_ptr<threading::ReactionTask> reschedule(
static std::unique_ptr<threading::ReactionTask> reschedule(
std::unique_ptr<threading::ReactionTask>&& task) {

// Lock our mutex
Expand Down
6 changes: 3 additions & 3 deletions docs/networking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ checks explicitly for an explicit type. Be careful about multiple declarations.
For this partial specialisation three static methods need to be defined.

.. codeblock:: c++
static inline std::vector<uint8_t> serialise(const T& in)
static std::vector<uint8_t> serialise(const T& in)

static inline T deserialise(const std::vector<uint8_t>& in)
static T deserialise(const std::vector<uint8_t>& in)

static inline uint64_t hash()
static uint64_t hash()

0 comments on commit 6b38694

Please sign in to comment.