| <html> |
| <head> |
| <title> |
| log4cxx - Documentation |
| </title> |
| <link href="../css/doxygen.css" rel="stylesheet" type="text/css"/> |
| </head> |
| |
| <body bgcolor="#ffffff" text="#000000" link="#525D76"> |
| <!-- START Header table --> |
| <table border="0" cellspacing="0" width="90%"> |
| <!-- TOP IMAGE --> |
| <tr> |
| <td colspan="2"> |
| <a href="http://logging.apache.org"> |
| <img src="http://logging.apache.org/images/ls-logo.jpg" align="left" border="0"/> |
| </a> |
| </td> |
| |
| </tr> |
| </table> |
| <!-- END Header table --> |
| |
| <!-- START main table --> |
| <table id="main" border="0" width="90%" cellspacing="2" cellpadding="0"> |
| <tr><td colspan="2"> |
| <hr noshade="" size="1"/> |
| </td></tr> |
| |
| <tr> |
| <!-- LEFT SIDE NAVIGATION --> |
| <td id="navbar" valign="top"> |
| <!-- ============================================================ --> |
| <table id="navbar" border="0" cellspacing="0" cellpadding="0"> |
| <tr > |
| <td class="navbarHeader" nowrap="true"> |
| <strong>Apache</strong> |
| </td> |
| </tr> |
| <tr><td class="navbarItem"><small> <a href="http://www.apache.org">Apache Home</a> |
| </small></td></tr> |
| <tr><td class="navbarItem"><small> <a href="http://logging.apache.org/">Logging Services</a> |
| </small></td></tr> |
| <tr > |
| <td class="navbarHeader" nowrap="true"> |
| <strong>log4cxx project</strong> |
| </td> |
| </tr> |
| <tr><td class="navbarItem"><small> <a href="../index.html">About</a> |
| </small></td></tr> |
| <tr><td class="navbarItem"><small> <a href="../news.html">News</a> |
| </small></td></tr> |
| <tr><td class="navbarItem"><small> <a href="../team.html">Team</a> |
| </small></td></tr> |
| <tr><td class="navbarItem"><small> <a href="../manual/index.html">Documentation</a> |
| </small></td></tr> |
| <tr><td class="navbarItem"><small> <a href="../performance.html">Performance</a> |
| </small></td></tr> |
| <tr><td class="navbarItem"><small> <a href="../download.html">Download</a> |
| </small></td></tr> |
| </table> |
| |
| </td> |
| <td id="mainContents" align="left" valign="top"> |
| <hr> |
| <!-- Generated by Doxygen 1.3.5 --> |
| <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> |
| <h1>CyclicBuffer Class Reference</h1><a href="classlog4cxx_1_1helpers_1_1CyclicBuffer-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> |
| <tr><td></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="classlog4cxx_1_1helpers_1_1CyclicBuffer.html#a0">CyclicBuffer</a> (int maxSize)</td></tr> |
| |
| <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1helpers_1_1CyclicBuffer.html#a2">add</a> (const <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> &event)</td></tr> |
| |
| <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1helpers_1_1CyclicBuffer.html#a3">get</a> (int i)</td></tr> |
| |
| <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1helpers_1_1CyclicBuffer.html#a5">get</a> ()</td></tr> |
| |
| <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1helpers_1_1CyclicBuffer.html#a6">length</a> () const </td></tr> |
| |
| <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1helpers_1_1CyclicBuffer.html#a7">resize</a> (int newSize)</td></tr> |
| |
| </table> |
| <hr><a name="_details"></a><h2>Detailed Description</h2> |
| <a class="el" href="classlog4cxx_1_1helpers_1_1CyclicBuffer.html">CyclicBuffer</a> is used by other appenders to hold <a class="el" href="classlog4cxx_1_1spi_1_1LoggingEvent.html">LoggingEvents</a> for immediate or differed display. <p> |
| This buffer gives read access to any element in the buffer not just the first or last element. |
| <p> |
| <hr><h2>Constructor & Destructor Documentation</h2> |
| <a class="anchor" name="a0" doxytag="log4cxx::helpers::CyclicBuffer::CyclicBuffer" ></a><p> |
| <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| <tr> |
| <td class="mdRow"> |
| <table cellpadding="0" cellspacing="0" border="0"> |
| <tr> |
| <td class="md" nowrap valign="top"> <a class="el" href="classlog4cxx_1_1helpers_1_1CyclicBuffer.html">CyclicBuffer</a> </td> |
| <td class="md" valign="top">( </td> |
| <td class="md" nowrap valign="top">int </td> |
| <td class="mdname1" valign="top" nowrap> <em>maxSize</em> </td> |
| <td class="md" valign="top"> ) </td> |
| <td class="md" nowrap></td> |
| </tr> |
| |
| </table> |
| </td> |
| </tr> |
| </table> |
| <table cellspacing=5 cellpadding=0 border=0> |
| <tr> |
| <td> |
| |
| </td> |
| <td> |
| |
| <p> |
| Instantiate a new <a class="el" href="classlog4cxx_1_1helpers_1_1CyclicBuffer.html">CyclicBuffer</a> of at most <code>maxSize</code> events. The <code>maxSize</code> argument must a positive integer. <dl compact><dt><b>Parameters:</b></dt><dd> |
| <table border="0" cellspacing="2" cellpadding="0"> |
| <tr><td valign=top><em>maxSize</em> </td><td>The maximum number of elements in the buffer. </td></tr> |
| </table> |
| </dl> |
| <dl compact><dt><b>Exceptions:</b></dt><dd> |
| <table border="0" cellspacing="2" cellpadding="0"> |
| <tr><td valign=top><em>IllegalArgumentException</em> </td><td>if <code>maxSize</code> is negative.</td></tr> |
| </table> |
| </dl> |
| </td> |
| </tr> |
| </table> |
| <hr><h2>Member Function Documentation</h2> |
| <a class="anchor" name="a2" doxytag="log4cxx::helpers::CyclicBuffer::add" ></a><p> |
| <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| <tr> |
| <td class="mdRow"> |
| <table cellpadding="0" cellspacing="0" border="0"> |
| <tr> |
| <td class="md" nowrap valign="top"> void add </td> |
| <td class="md" valign="top">( </td> |
| <td class="md" nowrap valign="top">const <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> & </td> |
| <td class="mdname1" valign="top" nowrap> <em>event</em> </td> |
| <td class="md" valign="top"> ) </td> |
| <td class="md" nowrap></td> |
| </tr> |
| |
| </table> |
| </td> |
| </tr> |
| </table> |
| <table cellspacing=5 cellpadding=0 border=0> |
| <tr> |
| <td> |
| |
| </td> |
| <td> |
| |
| <p> |
| Add an <code>event</code> as the last event in the buffer. </td> |
| </tr> |
| </table> |
| <a class="anchor" name="a5" doxytag="log4cxx::helpers::CyclicBuffer::get" ></a><p> |
| <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| <tr> |
| <td class="mdRow"> |
| <table cellpadding="0" cellspacing="0" border="0"> |
| <tr> |
| <td class="md" nowrap valign="top"> <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> get </td> |
| <td class="md" valign="top">( </td> |
| <td class="mdname1" valign="top" nowrap> </td> |
| <td class="md" valign="top"> ) </td> |
| <td class="md" nowrap></td> |
| </tr> |
| |
| </table> |
| </td> |
| </tr> |
| </table> |
| <table cellspacing=5 cellpadding=0 border=0> |
| <tr> |
| <td> |
| |
| </td> |
| <td> |
| |
| <p> |
| Get the oldest (first) element in the buffer. The oldest element is removed from the buffer. </td> |
| </tr> |
| </table> |
| <a class="anchor" name="a3" doxytag="log4cxx::helpers::CyclicBuffer::get" ></a><p> |
| <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| <tr> |
| <td class="mdRow"> |
| <table cellpadding="0" cellspacing="0" border="0"> |
| <tr> |
| <td class="md" nowrap valign="top"> <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> get </td> |
| <td class="md" valign="top">( </td> |
| <td class="md" nowrap valign="top">int </td> |
| <td class="mdname1" valign="top" nowrap> <em>i</em> </td> |
| <td class="md" valign="top"> ) </td> |
| <td class="md" nowrap></td> |
| </tr> |
| |
| </table> |
| </td> |
| </tr> |
| </table> |
| <table cellspacing=5 cellpadding=0 border=0> |
| <tr> |
| <td> |
| |
| </td> |
| <td> |
| |
| <p> |
| Get the <em>i</em>th oldest event currently in the buffer. If <em>i</em> is outside the range 0 to the number of elements currently in the buffer, then <code>null</code> is returned. </td> |
| </tr> |
| </table> |
| <a class="anchor" name="a6" doxytag="log4cxx::helpers::CyclicBuffer::length" ></a><p> |
| <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| <tr> |
| <td class="mdRow"> |
| <table cellpadding="0" cellspacing="0" border="0"> |
| <tr> |
| <td class="md" nowrap valign="top"> int length </td> |
| <td class="md" valign="top">( </td> |
| <td class="mdname1" valign="top" nowrap> </td> |
| <td class="md" valign="top"> ) </td> |
| <td class="md" nowrap> const<code> [inline]</code></td> |
| </tr> |
| |
| </table> |
| </td> |
| </tr> |
| </table> |
| <table cellspacing=5 cellpadding=0 border=0> |
| <tr> |
| <td> |
| |
| </td> |
| <td> |
| |
| <p> |
| Get the number of elements in the buffer. This number is guaranteed to be in the range 0 to <code>maxSize</code> (inclusive). </td> |
| </tr> |
| </table> |
| <a class="anchor" name="a7" doxytag="log4cxx::helpers::CyclicBuffer::resize" ></a><p> |
| <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| <tr> |
| <td class="mdRow"> |
| <table cellpadding="0" cellspacing="0" border="0"> |
| <tr> |
| <td class="md" nowrap valign="top"> void resize </td> |
| <td class="md" valign="top">( </td> |
| <td class="md" nowrap valign="top">int </td> |
| <td class="mdname1" valign="top" nowrap> <em>newSize</em> </td> |
| <td class="md" valign="top"> ) </td> |
| <td class="md" nowrap></td> |
| </tr> |
| |
| </table> |
| </td> |
| </tr> |
| </table> |
| <table cellspacing=5 cellpadding=0 border=0> |
| <tr> |
| <td> |
| |
| </td> |
| <td> |
| |
| <p> |
| Resize the cyclic buffer to <code>newSize</code>. <dl compact><dt><b>Exceptions:</b></dt><dd> |
| <table border="0" cellspacing="2" cellpadding="0"> |
| <tr><td valign=top><em>IllegalArgumentException</em> </td><td>if <code>newSize</code> is negative.</td></tr> |
| </table> |
| </dl> |
| </td> |
| </tr> |
| </table> |
| <hr>The documentation for this class was generated from the following files:<ul> |
| <li>cyclicbuffer.h<li>cyclicbuffer.cpp</ul> |
| |
| </td> |
| </tr> |
| |
| <!-- FOOTER --> |
| <tr><td colspan="2"> |
| <hr noshade="" size="1"/> |
| </td></tr> |
| <tr><td colspan="2"> |
| <div align="center"><font color="#525D76" size="-1"><em> |
| Copyright © 1999-2004, Apache Software Foundation |
| </em></font></div> |
| </td></tr> |
| </table> |
| <!-- END main table --> |
| </body> |
| </html> |
| <!-- end the processing --> |