include/entropic/types/run_scope.h¶
include/entropic/types/run_scope.h
Types
using entropic::RunStreamFn = typedef void (*)(const char* chunk, size_t len, void* user_data) hook point
Signature of a run's stream-chunk sink (gh#208, v2.14.2).
entropic::RunCancelScope
RAII publication of one run's cancel token to its own thread.
entropic::RunCancelScope::RunCancelScope(std::atomic< bool > *token)
Publish token as this thread's run cancel token.
gh#158 RAII enter — see header. Non-const since gh#158's audit pass: cancel_current_run() stops the run from inside it, which is a write.
- Parameters
token— Borrowed cancel flag; nullptr installs "no token".
- Returns
- n/a (constructor).
entropic::RunCancelScope::~RunCancelScope()
Restore the previously installed token.
gh#158 RAII exit — see header.
- Returns
- n/a (destructor).
entropic::RunCancelScope::RunCancelScope(const RunCancelScope &)=delete
RunCancelScope & entropic::RunCancelScope::operator=(const RunCancelScope &)=delete
entropic::RunSessionScope
RAII publication of one run's session key to its own thread.
entropic::RunSessionScope::RunSessionScope(std::string key)
Publish key as this thread's run session key.
gh#166 RAII enter — see header.
- Parameters
key— Session key ("" = the default session).key— Session key to publish.
- Returns
- n/a (constructor).
entropic::RunSessionScope::~RunSessionScope()
Restore the previously published key.
gh#166 RAII exit — see header.
- Returns
- n/a (destructor).
entropic::RunSessionScope::RunSessionScope(const RunSessionScope &)=delete
RunSessionScope & entropic::RunSessionScope::operator=(const RunSessionScope &)=delete
entropic::RunStreamScope
RAII: publish a streaming run's sink to its own thread (gh#208).
entropic::RunStreamScope::RunStreamScope(RunStreamFn fn, void *user_data)
Publish (fn, user_data) as this thread's stream sink.
Publish a streaming run's sink to this thread (gh#208).
- Parameters
fn— Sink; nullptr installs "no sink".user_data— Forwarded to fn.fn— Sink.
- Returns
- n/a (constructor).
entropic::RunStreamScope::~RunStreamScope()
Restore the previously published sink.
Restore the previous sink (gh#208).
- Returns
- n/a (destructor).
entropic::RunStreamScope::RunStreamScope(const RunStreamScope &)=delete
RunStreamScope & entropic::RunStreamScope::operator=(const RunStreamScope &)=delete