<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Class Poco::AutoReleasePool</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="language" content="en"/> <meta name="date" content="2009-11-24"/> <meta name="generator" content="PocoDoc"/> <link rel="stylesheet" href="css/styles.css" type="text/css"/> </head> <body bgcolor="#ffffff" leftmargin="0" topmargin="0"> <div class="header"> <h1 class="namespace"><a href="Poco.html" class="namespace">Poco</a></h1> <h1 class="template">template < class C ></h1> <h1 class="symbol">class AutoReleasePool</h1> </div> <div class="body"> <p> <b>Library:</b> Foundation<br /> <b>Package:</b> Core<br /> <b>Header:</b> Poco/AutoReleasePool.h</p> <h2>Description</h2> <div class="description"> <p>An <a href="Poco.AutoReleasePool.html" title="class Poco::AutoReleasePool">AutoReleasePool</a> implements simple garbage collection for reference-counted objects. It temporarily takes ownwership of reference-counted objects that nobody else wants to take ownership of and releases them at a later, appropriate point in time. </p> <p>Note: The correct way to add an object hold by an <a href="Poco.AutoPtr.html" title="class Poco::AutoPtr">AutoPtr</a><> to an <a href="Poco.AutoReleasePool.html" title="class Poco::AutoReleasePool">AutoReleasePool</a> is by invoking the <a href="Poco.AutoPtr.html" title="class Poco::AutoPtr">AutoPtr</a>'s duplicate() method. Example: </p> <pre>AutoReleasePool<C> arp; AutoPtr<C> ptr = new C; ... arp.add(ptr.duplicate()); </pre> </div> <h2>Member Summary</h2> <p><b>Member Functions: </b><a href="Poco.AutoReleasePool.html#3723" title="Poco::AutoReleasePool::add()">add</a>, <a href="Poco.AutoReleasePool.html#3725" title="Poco::AutoReleasePool::release()">release</a></p> <h2>Constructors</h2> <h3><a name="3721">AutoReleasePool</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.AutoReleasePool.html" title="class Poco::AutoReleasePool">AutoReleasePool</a>();</p> <div class="description"> <p>Creates the <a href="Poco.AutoReleasePool.html" title="class Poco::AutoReleasePool">AutoReleasePool</a>. </p> </div> <h2>Destructor</h2> <h3><a name="3722">~AutoReleasePool</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">~<a href="Poco.AutoReleasePool.html" title="class Poco::AutoReleasePool">AutoReleasePool</a>();</p> <div class="description"> <p>Destroys the <a href="Poco.AutoReleasePool.html" title="class Poco::AutoReleasePool">AutoReleasePool</a> and releases all objects it currently holds. </p> </div> <h2>Member Functions</h2> <h3><a name="3723">add</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">void add(<br /> C * pObject<br />);</p> <div class="description"> <p>Adds the given object to the <a href="Poco.AutoReleasePool.html" title="class Poco::AutoReleasePool">AutoReleasePool</a>. The object's reference count is not modified </p> </div> <h3><a name="3725">release</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">void release();</p> <div class="description"> <p>Releases all objects the <a href="Poco.AutoReleasePool.html" title="class Poco::AutoReleasePool">AutoReleasePool</a> currently holds by calling each object's <a href="Poco.AutoReleasePool.html#3725" title="Poco::AutoReleasePool::release()">release</a>() method. </p> </div> <p class="footer">POCO C++ Libraries 1.3.6-all<br /> Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p> </div> </body> </html>