#include <CodeContext.h>

Inheritance diagram for CodeContext:
Collaboration diagram for CodeContext:

Public Types

typedef RefCount< CodeContextPointer
 

Public Member Functions

virtual ~CodeContext ()
 
virtual ScopedId codeContextGist () const =0
 
virtual std::ostream & detailCodeContext (std::ostream &os) const =0
 appends human-friendly context description line(s) to a cache.log record More...
 

Static Public Member Functions

static const PointerCurrent ()
 
static void Reset ()
 forgets the current context, setting it to nil/unknown More...
 
static void Reset (const Pointer)
 changes the current context; nil argument sets it to nil/unknown More...
 

Static Private Member Functions

static void ForgetCurrent ()
 
static void Entering (const Pointer &codeCtx)
 
static void Leaving ()
 

Detailed Description

Interface for reporting what Squid code is working on. Such reports are usually requested outside creator's call stack. They are especially useful for attributing low-level errors to transactions.

Definition at line 20 of file CodeContext.h.

Member Typedef Documentation

◆ Pointer

Definition at line 23 of file CodeContext.h.

Constructor & Destructor Documentation

◆ ~CodeContext()

virtual CodeContext::~CodeContext ( )
inlinevirtual

Definition at line 34 of file CodeContext.h.

Member Function Documentation

◆ codeContextGist()

virtual ScopedId CodeContext::codeContextGist ( ) const
pure virtual
Returns
a small, permanent ID of the current context gists persist forever and are suitable for passing to other SMP workers

Implemented in Comm::Connection, AccessLogEntry, AnyP::PortCfg, FadingCodeContext, and htcpSpecifier.

Referenced by Entering(), and operator<<().

◆ Current()

◆ detailCodeContext()

virtual std::ostream& CodeContext::detailCodeContext ( std::ostream &  os) const
pure virtual

◆ Entering()

void CodeContext::Entering ( const Pointer codeCtx)
staticprivate

Switches the current context to the given known context. Improves debugging output by replacing omni-directional "Reset" with directional "Entering".

Definition at line 54 of file CodeContext.cc.

References codeContextGist(), debugs, ForgetCurrent(), and Instance().

Referenced by Reset().

◆ ForgetCurrent()

void CodeContext::ForgetCurrent ( )
staticprivate

Forgets the current known context, possibly triggering its destruction. Preserves the gist of the being-forgotten context during its destruction. Knows nothing about the next context – the caller must set it.

Definition at line 42 of file CodeContext.cc.

References assert, FadingCodeContext::gist, and Instance().

Referenced by Entering(), and Leaving().

◆ Leaving()

void CodeContext::Leaving ( )
staticprivate

Forgets the current known context. Improves debugging output by replacing omni-directional "Reset" with directional "Leaving".

Definition at line 66 of file CodeContext.cc.

References debugs, ForgetCurrent(), and Instance().

Referenced by Reset().

◆ Reset() [1/2]

◆ Reset() [2/2]

void CodeContext::Reset ( const Pointer  codeCtx)
static

Definition at line 82 of file CodeContext.cc.

References Current(), Entering(), and Leaving().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors