<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title> TemplateOsclExclusivePtrA< T, Alloc > class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<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="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center>
<hr><h1>OsclExclusivePtrA< T, Alloc > Class Template Reference<br>
<small>
[<a class="el" href="group__osclbase.html">OSCL Base</a>]</small>
</h1>The OsclExclusivePtrA class is a template class that defines any pointer like object intended to be assigned an address obtanined (directly or or indirectly) through Alloc. When the OsclExclusivePtrA expires, Alloc is used to free the memory.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="oscl__exclusive__ptr_8h-source.html">oscl_exclusive_ptr.h</a>></code>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#a0">OsclExclusivePtrA</a> (T *inPtr=0)</td></tr>
<tr><td> </td><td><font size=-1><em>Default constructor Initializes the pointer and takes ownership.</em> <a href="#a0"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#a1">OsclExclusivePtrA</a> (OsclExclusivePtrA< T, Alloc > &_Y)</td></tr>
<tr><td> </td><td><font size=-1><em>Copy constructor.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>OsclExclusivePtrA< T, Alloc > & </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#a2">operator=</a> (OsclExclusivePtrA< T, Alloc > &_Y)</td></tr>
<tr><td> </td><td><font size=-1><em>Assignment operator from an another <a class="el" href="classOsclExclusiveArrayPtr.html">OsclExclusiveArrayPtr</a>.</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#a3">~OsclExclusivePtrA</a> ()</td></tr>
<tr><td> </td><td><font size=-1><em>Destructor.</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>T & </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#a4">operator *</a> () const</td></tr>
<tr><td> </td><td><font size=-1><em>The indirection operator (*) accesses a value indirectly, through a pointer.</em> <a href="#a4"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>T * </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#a5">operator-></a> () const</td></tr>
<tr><td> </td><td><font size=-1><em>The indirection operator (->) accesses a value indirectly, through a pointer.</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>T * </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#a6">get</a> () const</td></tr>
<tr><td> </td><td><font size=-1><em><a class="el" href="classOsclExclusivePtrA.html#a6">get()</a> method returns the pointer, currently owned by the class.</em> <a href="#a6"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>T * </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#a7">release</a> ()</td></tr>
<tr><td> </td><td><font size=-1><em><a class="el" href="classOsclExclusivePtrA.html#a7">release()</a> method releases ownership of the pointer, currently owned by the class. It returns the pointer as well.</em> <a href="#a7"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#a8">set</a> (T *ptr)</td></tr>
<tr><td> </td><td><font size=-1><em><a class="el" href="classOsclExclusivePtrA.html#a8">set()</a> method sets ownership to the pointer, passed. This method is needed when the class is created with a default constructor. Returns false in case the class is non-empty.</em> <a href="#a8"></a><em></em></font><br><br></td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
<tr><td nowrap align=right valign=top>T * </td><td valign=bottom><a class="el" href="classOsclExclusivePtrA.html#n0">_Ptr</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<class T, class Alloc><br>
class OsclExclusivePtrA< T, Alloc ></h3>
The OsclExclusivePtrA class is a template class that defines any pointer like object intended to be assigned an address obtanined (directly or or indirectly) through Alloc. When the OsclExclusivePtrA expires, Alloc is used to free the memory.
<p>
The purpose of this class is to provide a way to prevent accidental memory leaks in a class or a method, due to "not remembering to delete" variables allocated on the heap. Thus if you assign an address returned by new to an <a class="el" href="classOsclExclusivePtr.html">OsclExclusivePtr</a> object, you don't have to remember to free the memory later, it will be freed automatically when the object goes out of scope. The <a class="el" href="classOsclExclusivePtr.html">OsclExclusivePtr</a> is an example of a smart pointer, an object that acts like a pointer, but with additional features. The class is defined so that it acts like a regular pointer in most respects
<p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a name="a0" doxytag="OsclExclusivePtrA::OsclExclusivePtrA"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> OsclExclusivePtrA< T, Alloc >::OsclExclusivePtrA </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">T * </td>
<td class="mdname1" valign="top" nowrap> <em>inPtr</em> = 0 </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [inline, explicit]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Default constructor Initializes the pointer and takes ownership.
<p>
</td>
</tr>
</table>
<a name="a1" doxytag="OsclExclusivePtrA::OsclExclusivePtrA"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> OsclExclusivePtrA< T, Alloc >::OsclExclusivePtrA </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">OsclExclusivePtrA< T, Alloc > & </td>
<td class="mdname1" valign="top" nowrap> <em>_Y</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Copy constructor.
<p>
Initializes the pointer and takes ownership from another <a class="el" href="classOsclExclusiveArrayPtr.html">OsclExclusiveArrayPtr</a>. Note that the other class does NOT own the pointer any longer, and hence it is NOT its responsibility to free it. </td>
</tr>
</table>
<a name="a3" doxytag="OsclExclusivePtrA::~OsclExclusivePtrA"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> virtual OsclExclusivePtrA< T, Alloc >::~OsclExclusivePtrA </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [inline, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Destructor.
<p>
The pointer is deleted in case this class still has ownership </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a6" doxytag="OsclExclusivePtrA::get"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T* OsclExclusivePtrA< T, Alloc >::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> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<a class="el" href="classOsclExclusivePtrA.html#a6">get()</a> method returns the pointer, currently owned by the class.
<p>
</td>
</tr>
</table>
<a name="a4" doxytag="OsclExclusivePtrA::operator *"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T& OsclExclusivePtrA< T, Alloc >::operator * </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>
The indirection operator (*) accesses a value indirectly, through a pointer.
<p>
This operator ensures that the <a class="el" href="classOsclExclusiveArrayPtr.html">OsclExclusiveArrayPtr</a> can be used like the regular pointer that it was initialized with. </td>
</tr>
</table>
<a name="a5" doxytag="OsclExclusivePtrA::operator->"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T* OsclExclusivePtrA< T, Alloc >::operator-> </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>
The indirection operator (->) accesses a value indirectly, through a pointer.
<p>
This operator ensures that the <a class="el" href="classOsclExclusiveArrayPtr.html">OsclExclusiveArrayPtr</a> can be used like the regular pointer that it was initialized with. </td>
</tr>
</table>
<a name="a2" doxytag="OsclExclusivePtrA::operator="></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> OsclExclusivePtrA<T, Alloc>& OsclExclusivePtrA< T, Alloc >::operator= </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">OsclExclusivePtrA< T, Alloc > & </td>
<td class="mdname1" valign="top" nowrap> <em>_Y</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Assignment operator from an another <a class="el" href="classOsclExclusiveArrayPtr.html">OsclExclusiveArrayPtr</a>.
<p>
<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>_Y</em> </td><td>
The value parameter should be another <a class="el" href="classOsclExclusiveArrayPtr.html">OsclExclusiveArrayPtr</a> </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
Returns a reference to this <a class="el" href="classOsclExclusiveArrayPtr.html">OsclExclusiveArrayPtr</a> instance with pointer initialized. </dl><dl compact><dt><b>Precondition: </b></dt><dd>
The input class should be non-null and should point to a valid pointer.</dl>This assignment operator initializes the class to the contents of the <a class="el" href="classOsclExclusiveArrayPtr.html">OsclExclusiveArrayPtr</a> given as the input parameter. The ownership of the pointer is transferred. </td>
</tr>
</table>
<a name="a7" doxytag="OsclExclusivePtrA::release"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T* OsclExclusivePtrA< T, Alloc >::release </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<a class="el" href="classOsclExclusivePtrA.html#a7">release()</a> method releases ownership of the pointer, currently owned by the class. It returns the pointer as well.
<p>
</td>
</tr>
</table>
<a name="a8" doxytag="OsclExclusivePtrA::set"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> bool OsclExclusivePtrA< T, Alloc >::set </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">T * </td>
<td class="mdname1" valign="top" nowrap> <em>ptr</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<a class="el" href="classOsclExclusivePtrA.html#a8">set()</a> method sets ownership to the pointer, passed. This method is needed when the class is created with a default constructor. Returns false in case the class is non-empty.
<p>
</td>
</tr>
</table>
<hr><h2>Field Documentation</h2>
<a name="n0" doxytag="OsclExclusivePtrA::_Ptr"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" colspan="4">
template<class T, class Alloc> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T* OsclExclusivePtrA< T, Alloc >::_Ptr<code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="oscl__exclusive__ptr_8h-source.html">oscl_exclusive_ptr.h</a></ul>
<hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
</small></address>
</body>
</html>