Apache Log4cxx  Version 1.3.1
Loading...
Searching...
No Matches
log4cxx::helpers::ThreadSpecificData Class Reference

This class contains all the thread-specific data in use by log4cxx. More...

#include <threadspecificdata.h>

Classes

struct  NamePair
 The names assigned to the current thread. More...
 

Public Types

using NamePairPtr = std::shared_ptr< NamePair >
 

Public Member Functions

 ThreadSpecificData ()
 
 ThreadSpecificData (ThreadSpecificData &&other)
 
 ~ThreadSpecificData ()
 
void recycle ()
 Remove current thread data from APR if the diagnostic context is empty.
 
NDC::StackgetStack ()
 The nested diagnostic context of the current thread.
 
MDC::MapgetMap ()
 The mapped diagnostic context of the current thread.
 

Static Public Member Functions

static ThreadSpecificDatagetCurrentData ()
 Gets current thread specific data.
 
static void put (const LogString &key, const LogString &val)
 Add the key val pair to the mapped diagnostic context of the current thread.
 
static void push (const LogString &val)
 Add val to the nested diagnostic context of the current thread.
 
static void inherit (const NDC::Stack &stack)
 Use stack as the nested diagnostic context of the current thread.
 
template<typename T >
static std::basic_ostringstream< T > & getStringStream ()
 A character outpur stream only assessable to the current thread.
 
static NamePairPtr getNames ()
 A reference counted pointer to the names of the current thread.
 

Detailed Description

This class contains all the thread-specific data in use by log4cxx.

Member Typedef Documentation

◆ NamePairPtr

Constructor & Destructor Documentation

◆ ThreadSpecificData() [1/2]

log4cxx::helpers::ThreadSpecificData::ThreadSpecificData ( )

◆ ThreadSpecificData() [2/2]

log4cxx::helpers::ThreadSpecificData::ThreadSpecificData ( ThreadSpecificData &&  other)

◆ ~ThreadSpecificData()

log4cxx::helpers::ThreadSpecificData::~ThreadSpecificData ( )

Member Function Documentation

◆ getCurrentData()

static ThreadSpecificData * log4cxx::helpers::ThreadSpecificData::getCurrentData ( )
static

Gets current thread specific data.

Returns
a pointer that is non-null prior to application exit.

◆ getMap()

MDC::Map & log4cxx::helpers::ThreadSpecificData::getMap ( )

The mapped diagnostic context of the current thread.

◆ getNames()

static NamePairPtr log4cxx::helpers::ThreadSpecificData::getNames ( )
static

A reference counted pointer to the names of the current thread.

String references will remain valid for the lifetime of this pointer (i.e. even after thread termination).

◆ getStack()

NDC::Stack & log4cxx::helpers::ThreadSpecificData::getStack ( )

The nested diagnostic context of the current thread.

◆ getStringStream()

template<typename T >
static std::basic_ostringstream< T > & log4cxx::helpers::ThreadSpecificData::getStringStream ( )
inlinestatic

A character outpur stream only assessable to the current thread.

◆ inherit()

static void log4cxx::helpers::ThreadSpecificData::inherit ( const NDC::Stack stack)
static

Use stack as the nested diagnostic context of the current thread.

◆ push()

static void log4cxx::helpers::ThreadSpecificData::push ( const LogString val)
static

Add val to the nested diagnostic context of the current thread.

◆ put()

static void log4cxx::helpers::ThreadSpecificData::put ( const LogString key,
const LogString val 
)
static

Add the key val pair to the mapped diagnostic context of the current thread.

◆ recycle()

void log4cxx::helpers::ThreadSpecificData::recycle ( )

Remove current thread data from APR if the diagnostic context is empty.


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