<!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> TemplateOsclExclusiveArrayPtr< T > 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>OsclExclusiveArrayPtr< T > Class Template Reference<br>
<small>
[<a class="el" href="group__osclbase.html">OSCL Base</a>]</small>
</h1>The OsclExclusiveArrayPtr class is a template class that defines an array pointer like object intended to be assigned an address obtanined (directly or or indirectly) by new. When the OsclExclusiveArrayPtr expires, its destructor uses delete 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="classOsclExclusiveArrayPtr.html#a0">OsclExclusiveArrayPtr</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="classOsclExclusiveArrayPtr.html#a1">OsclExclusiveArrayPtr</a> (OsclExclusiveArrayPtr< T > &_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>OsclExclusiveArrayPtr< T > & </td><td valign=bottom><a class="el" href="classOsclExclusiveArrayPtr.html#a2">operator=</a> (OsclExclusiveArrayPtr< T > &_Y)</td></tr>
<tr><td> </td><td><font size=-1><em>Assignment operator from an another OsclExclusiveArrayPtr.</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="classOsclExclusiveArrayPtr.html#a3">~OsclExclusiveArrayPtr</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="classOsclExclusiveArrayPtr.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="classOsclExclusiveArrayPtr.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="classOsclExclusiveArrayPtr.html#a6">get</a> () const</td></tr>
<tr><td> </td><td><font size=-1><em><a class="el" href="classOsclExclusiveArrayPtr.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="classOsclExclusiveArrayPtr.html#a7">release</a> ()</td></tr>
<tr><td> </td><td><font size=-1><em><a class="el" href="classOsclExclusiveArrayPtr.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="classOsclExclusiveArrayPtr.html#a8">set</a> (T *ptr)</td></tr>
<tr><td> </td><td><font size=-1><em><a class="el" href="classOsclExclusiveArrayPtr.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="classOsclExclusiveArrayPtr.html#n0">_Ptr</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<class T><br>
class OsclExclusiveArrayPtr< T ></h3>
The OsclExclusiveArrayPtr class is a template class that defines an array pointer like object intended to be assigned an address obtanined (directly or or indirectly) by new. When the OsclExclusiveArrayPtr expires, its destructor uses delete 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="OsclExclusiveArrayPtr::OsclExclusiveArrayPtr"></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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> OsclExclusiveArrayPtr< T >::OsclExclusiveArrayPtr </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="OsclExclusiveArrayPtr::OsclExclusiveArrayPtr"></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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> OsclExclusiveArrayPtr< T >::OsclExclusiveArrayPtr </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">OsclExclusiveArrayPtr< T > & </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 OsclExclusiveArrayPtr. 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="OsclExclusiveArrayPtr::~OsclExclusiveArrayPtr"></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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> virtual OsclExclusiveArrayPtr< T >::~OsclExclusiveArrayPtr </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="OsclExclusiveArrayPtr::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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T* OsclExclusiveArrayPtr< T >::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="classOsclExclusiveArrayPtr.html#a6">get()</a> method returns the pointer, currently owned by the class.
<p>
</td>
</tr>
</table>
<a name="a4" doxytag="OsclExclusiveArrayPtr::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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T& OsclExclusiveArrayPtr< T >::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 OsclExclusiveArrayPtr can be used like the regular pointer that it was initialized with. </td>
</tr>
</table>
<a name="a5" doxytag="OsclExclusiveArrayPtr::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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T* OsclExclusiveArrayPtr< T >::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 OsclExclusiveArrayPtr can be used like the regular pointer that it was initialized with. </td>
</tr>
</table>
<a name="a2" doxytag="OsclExclusiveArrayPtr::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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> OsclExclusiveArrayPtr<T>& OsclExclusiveArrayPtr< T >::operator= </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">OsclExclusiveArrayPtr< T > & </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 OsclExclusiveArrayPtr.
<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 OsclExclusiveArrayPtr </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
Returns a reference to this OsclExclusiveArrayPtr 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 OsclExclusiveArrayPtr given as the input parameter. The ownership of the pointer is transferred. </td>
</tr>
</table>
<a name="a7" doxytag="OsclExclusiveArrayPtr::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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T* OsclExclusiveArrayPtr< T >::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="classOsclExclusiveArrayPtr.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="OsclExclusiveArrayPtr::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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> bool OsclExclusiveArrayPtr< T >::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="classOsclExclusiveArrayPtr.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="OsclExclusiveArrayPtr::_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> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> T* OsclExclusiveArrayPtr< T >::_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>