DF-0
DF-0: Data processing Framework with Zero-overhead
Loading...
Searching...
No Matches
df0::message_callbacks Struct Reference

Callback bundle used by pipeline elements to emit messages. More...

#include <message.h>

Public Member Functions

continuation further (message_ptr msg) const
template<typename T>
requires (!std::is_convertible_v<std::remove_cvref_t<T>, message_ptr> && !std::derived_from<std::remove_cvref_t<T>, message_base>)
continuation further (T &&object) const
continuation back (message_ptr msg) const
template<typename T>
requires (!std::is_convertible_v<std::remove_cvref_t<T>, message_ptr> && !std::derived_from<std::remove_cvref_t<T>, message_base>)
continuation back (T &&object) const
continuation operator() (message_ptr msg) const
template<typename T>
requires (!std::is_convertible_v<std::remove_cvref_t<T>, message_ptr> && !std::derived_from<std::remove_cvref_t<T>, message_base>)
continuation operator() (T &&object) const

Public Attributes

std::function< continuation(message_ptr)> m_further
std::function< continuation(message_ptr)> m_back

Detailed Description

Callback bundle used by pipeline elements to emit messages.

There are two independent directions:

  • further sends a message to the next element on the right.
  • back sends a message back to the beginning of the fully assembled pipeline so that it can be processed by the whole pipeline again.

back is intended for embedded/nested content. For example, a document parser may discover an embedded image and call back(image_data) so that the image is processed again from the pipeline source and can reach OCR.

Note
A back-emitted message must not be pipeline::start_processing. Sending start_processing backwards is indistinguishable from the initial pipeline start and can cause infinite recursion.
Both further and back wrap raw payload types into a message<T>. Passing an already-created message_ptr forwards it without re-wrapping.

Definition at line 89 of file message.h.

Member Function Documentation

◆ back() [1/2]

continuation df0::message_callbacks::back ( message_ptr msg) const
inline

Definition at line 101 of file message.h.

◆ back() [2/2]

template<typename T>
requires (!std::is_convertible_v<std::remove_cvref_t<T>, message_ptr> && !std::derived_from<std::remove_cvref_t<T>, message_base>)
continuation df0::message_callbacks::back ( T && object) const
inline

Definition at line 106 of file message.h.

◆ further() [1/2]

continuation df0::message_callbacks::further ( message_ptr msg) const
inline

Definition at line 94 of file message.h.

◆ further() [2/2]

template<typename T>
requires (!std::is_convertible_v<std::remove_cvref_t<T>, message_ptr> && !std::derived_from<std::remove_cvref_t<T>, message_base>)
continuation df0::message_callbacks::further ( T && object) const
inline

Definition at line 99 of file message.h.

◆ operator()() [1/2]

continuation df0::message_callbacks::operator() ( message_ptr msg) const
inline

Definition at line 108 of file message.h.

◆ operator()() [2/2]

template<typename T>
requires (!std::is_convertible_v<std::remove_cvref_t<T>, message_ptr> && !std::derived_from<std::remove_cvref_t<T>, message_base>)
continuation df0::message_callbacks::operator() ( T && object) const
inline

Definition at line 113 of file message.h.

Member Data Documentation

◆ m_back

std::function<continuation(message_ptr)> df0::message_callbacks::m_back

Definition at line 92 of file message.h.

◆ m_further

std::function<continuation(message_ptr)> df0::message_callbacks::m_further

Definition at line 91 of file message.h.


The documentation for this struct was generated from the following file: