

Go to the source code of this file.
Classes | |
class | CodeContext |
class | CodeContextGuard |
Functions | |
std::ostream & | operator<< (std::ostream &os, const CodeContext &ctx) |
by default, only small context gist is printed More... | |
std::ostream & | CurrentCodeContextBrief (std::ostream &os) |
std::ostream & | CurrentCodeContextDetail (std::ostream &os) |
template<typename Fun > | |
void | CallBack (const CodeContext::Pointer &callbackContext, Fun &&callback) |
template<typename Fun > | |
void | CallService (const CodeContext::Pointer &serviceContext, Fun &&service) |
template<typename Fun > | |
void | CallContextCreator (Fun &&creator) |
Function Documentation
◆ CallBack()
|
inline |
Executes service callback
in callbackContext
. If an exception occurs, the callback context is preserved, so that the exception is associated with the callback that triggered them (rather than with the service).
Service code running in its own service context should use this function.
Definition at line 81 of file CodeContext.h.
References callback, CodeContext::Current(), and CodeContext::Reset().
Referenced by HappyOrderEnforcer::checkpoint(), IpcIoFile::checkTimeouts(), commHalfClosedCheck(), Ipc::UdsSender::DelayedRetry(), IpcIoFile::handleResponse(), idnsCallbackAllCallersWithNewAnswer(), PeerSelectorPingMonitor::noteWaitOver(), peerCountMcastPeersDone(), Ipc::Forwarder::RequestTimedOut(), Ipc::Inquirer::RequestTimedOut(), and ClientInfo::writeOrDequeue().
◆ CallContextCreator()
|
inline |
Executes context creator
in the service context. If an exception occurs, the creator context is preserved, so that the exception is associated with the creator that triggered them (rather than with the service).
Service code running in its own context should use this function to create new code contexts. TODO: Use or, if this pattern is not repeated, remove.
Definition at line 113 of file CodeContext.h.
References CodeContext::Current(), and CodeContext::Reset().
Referenced by peerCountMcastPeersStart().
◆ CallService()
|
inline |
Executes service
in serviceContext
but due to automatic caller context restoration, service exceptions are associated with the caller that suffered from (and/or caused) them (rather than with the service itself).
Service code running in caller's context should use this function to escape into service context (e.g., for submitting caller-agnostic requests).
Definition at line 98 of file CodeContext.h.
Referenced by IpcIoFile::push(), and IpcIoFile::scheduleTimeoutCheck().
◆ CurrentCodeContextBrief()
std::ostream& CurrentCodeContextBrief | ( | std::ostream & | os | ) |
◆ CurrentCodeContextDetail()
std::ostream& CurrentCodeContextDetail | ( | std::ostream & | os | ) |
Definition at line 94 of file CodeContext.cc.
References CodeContext::Current().
Referenced by Debug::Finish().
◆ operator<<()
|
inline |
Definition at line 51 of file CodeContext.h.
References CodeContext::codeContextGist().