<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>log4cpp: log4cpp::NDC Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespacelog4cpp.html">log4cpp</a>::<a class="el" href="classlog4cpp_1_1NDC.html">NDC</a> </div> </div> <div class="contents"> <h1>log4cpp::NDC Class Reference</h1><!-- doxytag: class="log4cpp::NDC" -->The <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> class implements <em>nested diagnostic contexts</em> as defined by Neil Harrison in the article "Patterns for Logging Diagnostic Messages" part of the book "<em>Pattern Languages of Program Design 3</em>" edited by Martin et al. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="NDC_8hh_source.html">NDC.hh</a>></code> <p> <p> <a href="classlog4cpp_1_1NDC-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Classes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structlog4cpp_1_1NDC_1_1DiagnosticContext.html">DiagnosticContext</a></td></tr> <tr><td colspan="2"><br><h2>Public Types</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::vector<br class="typebreak"> < <a class="el" href="structlog4cpp_1_1NDC_1_1DiagnosticContext.html">DiagnosticContext</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">ContextStack</a></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#52f957aadc13895525e83868df67d135">NDC</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#f36717d0f779e7b245b2bf92f8654de9">~NDC</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#6b6996557e556df29623fd14ac6661b0">_clear</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">ContextStack</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#3bc4401426802baead3ae93f6760f10e">_cloneStack</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#cfa967a7ec04d739872126366d696b78">_get</a> () const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#b6e63b225f872dc67514c092fb67a4e9">_getDepth</a> () const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#dc72c5bcb57815f5ceafe1c6ee40465f">_inherit</a> (<a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">ContextStack</a> *stack)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#4af8a96d401edf56d57d1f3d780ac321">_pop</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#ed936d87ab91ef44fe463406a009f05c">_push</a> (const std::string &message)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#9ec662bf36a7509304c77bd97ee58bcb">_setMaxDepth</a> (int maxDepth)</td></tr> <tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#b0d6de25209c63a51889eba89dd6181d">clear</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Clear any nested disgnostic information if any. <a href="#b0d6de25209c63a51889eba89dd6181d"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">ContextStack</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#f1c32f92de0b64e67af2dd568310279f">cloneStack</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Clone the diagnostic context for the current thread. <a href="#f1c32f92de0b64e67af2dd568310279f"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#62a7cb56ef73bde377b2a9963bb86661">get</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the current diagnostic context string. <a href="#62a7cb56ef73bde377b2a9963bb86661"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#6142056be34a16e121d0b9b1bf986e7e">getDepth</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the current nesting depth of this diagnostic context. <a href="#6142056be34a16e121d0b9b1bf986e7e"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#f03f56251d0fd18a7b539b957a6cdacd">inherit</a> (<a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">ContextStack</a> *stack)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#4c0720efccfc299a49801f7a35352f77">pop</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Clients should call this method before leaving a diagnostic context. <a href="#4c0720efccfc299a49801f7a35352f77"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#d4f07aa423a2855ce00f6d7642ec86be">push</a> (const std::string &message)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Push new diagnostic context information for the current thread. <a href="#d4f07aa423a2855ce00f6d7642ec86be"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#60cc6e40fb64bfb8f086878584ef78e6">setMaxDepth</a> (int maxDepth)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the maximum nesting depth for the current <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a>. <a href="#60cc6e40fb64bfb8f086878584ef78e6"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classlog4cpp_1_1NDC.html">NDC</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#81679eb19f8eb74a73ffec884bd2eb77">getNDC</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> for the current thread. <a href="#81679eb19f8eb74a73ffec884bd2eb77"></a><br></td></tr> <tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">ContextStack</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1NDC.html#1f9df91c6a43669c80d6c053b1fab6c8">_stack</a></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> The <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> class implements <em>nested diagnostic contexts</em> as defined by Neil Harrison in the article "Patterns for Logging Diagnostic Messages" part of the book "<em>Pattern Languages of Program Design 3</em>" edited by Martin et al. <p> A Nested Diagnostic Context, or <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> in short, is an instrument to distinguish interleaved log output from different sources. Log output is typically interleaved when a server handles multiple clients near-simulatanously.<p> Interleaved log output can still be meaningful if each log entry from different contexts had a distinctive stamp. This is where NDCs come into play.<p> <em><b>Note that NDCs are managed on a per thread basis</b></em>. <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> operations such as <code>push</code>, <code> pop</code>, <code>clear</code>, <code>getDepth</code> and <code> setMaxDepth</code> affect the <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> of the <em>current</em> thread only. NDCs of other threads remain unaffected.<p> To build an <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> one uses the <code>push</code> operation. Simply put,<p> <ul> <li> Contexts can be nested.<p> <p> </li> <li> When entering a context, call <code><a class="el" href="classlog4cpp_1_1NDC.html#d4f07aa423a2855ce00f6d7642ec86be" title="Push new diagnostic context information for the current thread.">NDC.push</a></code>. As a side effect, if there is no nested diagnostic context for the current thread, this method will create it.<p> <p> </li> <li> When leaving a context, call <code><a class="el" href="classlog4cpp_1_1NDC.html#4c0720efccfc299a49801f7a35352f77" title="Clients should call this method before leaving a diagnostic context.">NDC.pop</a></code>. </li> </ul> <p> There is no penalty for forgetting to match each <code>push</code> operation with a corresponding <code>pop</code>, except the obvious mismatch between the real application context and the context set in the <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a>.<p> Custom Layouts may include the nested diagnostic context for the current thread in log messages, without any user intervention. Hence, even if a server is serving multiple clients simultaneously, the logs emanating from the same code (belonging to the same category) can still be distinguished because each client request will have a different <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> tag.<p> <em>Unfortunately, unlike Java, C++ does not have platform independent multithreading support. Therefore, currently <a class="el" href="namespacelog4cpp.html" title="The top level namespace for all 'Log for C++' types and classes.">log4cpp</a> is not multithread aware, it implicitly assumes only one thread exists, the main process thread. </em> <hr><h2>Member Typedef Documentation</h2> <a class="anchor" name="ea4fa13814448adfa837884422360775"></a><!-- doxytag: member="log4cpp::NDC::ContextStack" ref="ea4fa13814448adfa837884422360775" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef std::vector<<a class="el" href="structlog4cpp_1_1NDC_1_1DiagnosticContext.html">DiagnosticContext</a>> <a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">log4cpp::NDC::ContextStack</a> </td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="52f957aadc13895525e83868df67d135"></a><!-- doxytag: member="log4cpp::NDC::NDC" ref="52f957aadc13895525e83868df67d135" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">log4cpp::NDC::NDC </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="f36717d0f779e7b245b2bf92f8654de9"></a><!-- doxytag: member="log4cpp::NDC::~NDC" ref="f36717d0f779e7b245b2bf92f8654de9" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">log4cpp::NDC::~NDC </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="6b6996557e556df29623fd14ac6661b0"></a><!-- doxytag: member="log4cpp::NDC::_clear" ref="6b6996557e556df29623fd14ac6661b0" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::NDC::_clear </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="3bc4401426802baead3ae93f6760f10e"></a><!-- doxytag: member="log4cpp::NDC::_cloneStack" ref="3bc4401426802baead3ae93f6760f10e" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">NDC::ContextStack</a> * log4cpp::NDC::_cloneStack </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="cfa967a7ec04d739872126366d696b78"></a><!-- doxytag: member="log4cpp::NDC::_get" ref="cfa967a7ec04d739872126366d696b78" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const std::string & log4cpp::NDC::_get </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="b6e63b225f872dc67514c092fb67a4e9"></a><!-- doxytag: member="log4cpp::NDC::_getDepth" ref="b6e63b225f872dc67514c092fb67a4e9" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">size_t log4cpp::NDC::_getDepth </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="dc72c5bcb57815f5ceafe1c6ee40465f"></a><!-- doxytag: member="log4cpp::NDC::_inherit" ref="dc72c5bcb57815f5ceafe1c6ee40465f" args="(ContextStack *stack)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::NDC::_inherit </td> <td>(</td> <td class="paramtype"><a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">NDC::ContextStack</a> * </td> <td class="paramname"> <em>stack</em> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="4af8a96d401edf56d57d1f3d780ac321"></a><!-- doxytag: member="log4cpp::NDC::_pop" ref="4af8a96d401edf56d57d1f3d780ac321" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string log4cpp::NDC::_pop </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="ed936d87ab91ef44fe463406a009f05c"></a><!-- doxytag: member="log4cpp::NDC::_push" ref="ed936d87ab91ef44fe463406a009f05c" args="(const std::string &message)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::NDC::_push </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>message</em> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="9ec662bf36a7509304c77bd97ee58bcb"></a><!-- doxytag: member="log4cpp::NDC::_setMaxDepth" ref="9ec662bf36a7509304c77bd97ee58bcb" args="(int maxDepth)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::NDC::_setMaxDepth </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>maxDepth</em> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="b0d6de25209c63a51889eba89dd6181d"></a><!-- doxytag: member="log4cpp::NDC::clear" ref="b0d6de25209c63a51889eba89dd6181d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::NDC::clear </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Clear any nested disgnostic information if any. <p> This method is useful in cases where the same thread can be potentially used over and over in different unrelated contexts.<p> This method is equivalent to calling the <code>setMaxDepth</code> method with a zero <code>maxDepth</code> argument. </div> </div><p> <a class="anchor" name="f1c32f92de0b64e67af2dd568310279f"></a><!-- doxytag: member="log4cpp::NDC::cloneStack" ref="f1c32f92de0b64e67af2dd568310279f" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">NDC::ContextStack</a> * log4cpp::NDC::cloneStack </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Clone the diagnostic context for the current thread. <p> Internally a diagnostic context is represented as a stack. A given thread can supply the stack (i.e. diagnostic context) to a child thread so that the child can inherit the parent thread's diagnostic context.<p> The child thread uses the <code>inherit</code> method to inherit the parent's diagnostic context.<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Stack A clone of the current thread's diagnostic context. </dd></dl> </div> </div><p> <a class="anchor" name="62a7cb56ef73bde377b2a9963bb86661"></a><!-- doxytag: member="log4cpp::NDC::get" ref="62a7cb56ef73bde377b2a9963bb86661" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const std::string & log4cpp::NDC::get </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Get the current diagnostic context string. <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>the context string. </dd></dl> </div> </div><p> <a class="anchor" name="6142056be34a16e121d0b9b1bf986e7e"></a><!-- doxytag: member="log4cpp::NDC::getDepth" ref="6142056be34a16e121d0b9b1bf986e7e" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">size_t log4cpp::NDC::getDepth </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Get the current nesting depth of this diagnostic context. <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>the nesting depth </dd></dl> </div> </div><p> <a class="anchor" name="81679eb19f8eb74a73ffec884bd2eb77"></a><!-- doxytag: member="log4cpp::NDC::getNDC" ref="81679eb19f8eb74a73ffec884bd2eb77" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classlog4cpp_1_1NDC.html">NDC</a> & log4cpp::NDC::getNDC </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> for the current thread. <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>the <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> for the current thread </dd></dl> </div> </div><p> <a class="anchor" name="f03f56251d0fd18a7b539b957a6cdacd"></a><!-- doxytag: member="log4cpp::NDC::inherit" ref="f03f56251d0fd18a7b539b957a6cdacd" args="(ContextStack *stack)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::NDC::inherit </td> <td>(</td> <td class="paramtype"><a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">NDC::ContextStack</a> * </td> <td class="paramname"> <em>stack</em> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="4c0720efccfc299a49801f7a35352f77"></a><!-- doxytag: member="log4cpp::NDC::pop" ref="4c0720efccfc299a49801f7a35352f77" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string log4cpp::NDC::pop </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Clients should call this method before leaving a diagnostic context. <p> The returned value is the value that was pushed last. If no context is available, then the empty string "" is returned.<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>String The innermost diagnostic context. </dd></dl> </div> </div><p> <a class="anchor" name="d4f07aa423a2855ce00f6d7642ec86be"></a><!-- doxytag: member="log4cpp::NDC::push" ref="d4f07aa423a2855ce00f6d7642ec86be" args="(const std::string &message)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::NDC::push </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>message</em> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Push new diagnostic context information for the current thread. <p> The contents of the <code>message</code> parameter is determined solely by the client.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>message</em> </td><td>The new diagnostic context information. </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="60cc6e40fb64bfb8f086878584ef78e6"></a><!-- doxytag: member="log4cpp::NDC::setMaxDepth" ref="60cc6e40fb64bfb8f086878584ef78e6" args="(int maxDepth)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::NDC::setMaxDepth </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>maxDepth</em> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Set the maximum nesting depth for the current <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a>. <p> Curently NDCs do not enforce a maximum depth and consequentially this method has no effect. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>maxDepth</em> </td><td>the maximum nesting depth </td></tr> </table> </dl> </div> </div><p> <hr><h2>Member Data Documentation</h2> <a class="anchor" name="1f9df91c6a43669c80d6c053b1fab6c8"></a><!-- doxytag: member="log4cpp::NDC::_stack" ref="1f9df91c6a43669c80d6c053b1fab6c8" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classlog4cpp_1_1NDC.html#ea4fa13814448adfa837884422360775">ContextStack</a> <a class="el" href="classlog4cpp_1_1NDC.html#1f9df91c6a43669c80d6c053b1fab6c8">log4cpp::NDC::_stack</a> </td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="NDC_8hh_source.html">NDC.hh</a><li><a class="el" href="NDC_8cpp.html">NDC.cpp</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 26 19:34:33 2009 for log4cpp by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>