Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 77

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!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>Crystal Space 1.2.1: CS::DataBuffer&lt; Allocator &gt; Class Template Reference (Crystal Space 1.2.1 Public API Reference)</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="head">
 <tr height="59">
  <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td>
  <td class="head"><h2>Public API Reference</h2></td>
 </tr>
 <tr height="11">
  <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td>
 </tr>
</table>
<div class="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li class="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<div class="nav">
<a class="el" href="namespaceCS.html">CS</a>::<a class="el" href="classCS_1_1DataBuffer.html">DataBuffer</a></div>
<h1>CS::DataBuffer&lt; Allocator &gt; Class Template Reference</h1><!-- doxytag: class="CS::DataBuffer" --><!-- doxytag: inherits="scfImplementation1" -->This is an implementation of <a class="el" href="structiDataBuffer.html" title="The iDataBuffer interface can be used to exchange buffers with abstract data between...">iDataBuffer</a> interface.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="databuf_8h-source.html">csutil/databuf.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for CS::DataBuffer&lt; Allocator &gt;:</div>
<div class="dynsection">
<p><center><img src="classCS_1_1DataBuffer__inherit__graph.png" border="0" usemap="#CS_1_1DataBuffer_3_01Allocator_01_4__inherit__map" alt="Inheritance graph"></center>
<map name="CS_1_1DataBuffer_3_01Allocator_01_4__inherit__map">
<area shape="rect" href="classscfImplementation1.html" title="scfImplementation1\&lt; CS::DataBuffer\&lt; Allocator \&gt;, iDataBuffer \&gt;" alt="" coords="5,161,456,188"><area shape="rect" href="classscfImplementation.html" title="Baseclass for the SCF implementation templates." alt="" coords="128,84,333,111"><area shape="rect" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one..." alt="" coords="121,7,177,33"><area shape="rect" href="classCS_1_1Memory_1_1CustomAllocated.html" title="Class that overrides operator new/operator delete/etc." alt="" coords="201,7,423,33"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classCS_1_1DataBuffer-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">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1DataBuffer.html#91837377d2c4f003b3fb54e558ab5ab8">DataBuffer</a> (<a class="el" href="structiDataBuffer.html">iDataBuffer</a> *source)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Duplicate an existing data buffer. Also appends a 0 char.  <a href="#91837377d2c4f003b3fb54e558ab5ab8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1DataBuffer.html#c43f0672779cdb6cfb0141fcdcf603b6">DataBuffer</a> (char *iData, size_t iSize, bool should_delete=true)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct an data buffer object given a existing pointer.  <a href="#c43f0672779cdb6cfb0141fcdcf603b6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1DataBuffer.html#f8432cee1eae8184fe1c59cea025b7bc">DataBuffer</a> (size_t iSize, const Allocator &amp;alloc)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct an preallocated data buffer (filled with garbage initially).  <a href="#f8432cee1eae8184fe1c59cea025b7bc"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1DataBuffer.html#21ce1462604c23de2364bc6777683133">DataBuffer</a> (size_t iSize)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct an preallocated data buffer (filled with garbage initially).  <a href="#21ce1462604c23de2364bc6777683133"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1DataBuffer.html#a893a6cb4bd9809bbcbb15e51d9ed29d">GetData</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the buffer as an abstract pointer.  <a href="#a893a6cb4bd9809bbcbb15e51d9ed29d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1DataBuffer.html#e5d6fcf7bb137d4cc1be7ecb9ef55707">GetDeleteOnDestruct</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return true if this databuffer will destroy its memory on destruction.  <a href="#e5d6fcf7bb137d4cc1be7ecb9ef55707"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1DataBuffer.html#e549e5483eadac80d085dbe4b8a66cd3">GetSize</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Query the buffer size.  <a href="#e549e5483eadac80d085dbe4b8a66cd3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1DataBuffer.html#5878d572b0ec8e8309c89ec621acdb3d">~DataBuffer</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy (free) the buffer.  <a href="#5878d572b0ec8e8309c89ec621acdb3d"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class Allocator = Memory::AllocatorMalloc&gt;<br>
 class CS::DataBuffer&lt; Allocator &gt;</h3>

This is an implementation of <a class="el" href="structiDataBuffer.html" title="The iDataBuffer interface can be used to exchange buffers with abstract data between...">iDataBuffer</a> interface. 
<p>
The object is extremely lightweight and is recommended for use in plugins as a mean to transparently exchange abstract data between plugins. 
<p>Definition at line <a class="el" href="databuf_8h-source.html#l00041">41</a> of file <a class="el" href="databuf_8h-source.html">databuf.h</a>.</p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="21ce1462604c23de2364bc6777683133"></a><!-- doxytag: member="CS::DataBuffer::DataBuffer" ref="21ce1462604c23de2364bc6777683133" args="(size_t iSize)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Allocator = Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classCS_1_1DataBuffer.html">CS::DataBuffer</a>&lt; Allocator &gt;::<a class="el" href="classCS_1_1DataBuffer.html">DataBuffer</a>           </td>
          <td>(</td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>iSize</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Construct an preallocated data buffer (filled with garbage initially). 
<p>

<p>Definition at line <a class="el" href="databuf_8h-source.html#l00053">53</a> of file <a class="el" href="databuf_8h-source.html">databuf.h</a>.</p>

<p>References <a class="el" href="allocator_8h-source.html#l00365">CS::Memory::AllocatorPointerWrapper&lt; T, Allocator &gt;::p</a>.</p>

</div>
</div><p>
<a class="anchor" name="f8432cee1eae8184fe1c59cea025b7bc"></a><!-- doxytag: member="CS::DataBuffer::DataBuffer" ref="f8432cee1eae8184fe1c59cea025b7bc" args="(size_t iSize, const Allocator &amp;alloc)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Allocator = Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classCS_1_1DataBuffer.html">CS::DataBuffer</a>&lt; Allocator &gt;::<a class="el" href="classCS_1_1DataBuffer.html">DataBuffer</a>           </td>
          <td>(</td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>iSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Allocator &amp;&nbsp;</td>
          <td class="paramname"> <em>alloc</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Construct an preallocated data buffer (filled with garbage initially). 
<p>

<p>Definition at line <a class="el" href="databuf_8h-source.html#l00060">60</a> of file <a class="el" href="databuf_8h-source.html">databuf.h</a>.</p>

<p>References <a class="el" href="allocator_8h-source.html#l00365">CS::Memory::AllocatorPointerWrapper&lt; T, Allocator &gt;::p</a>.</p>

</div>
</div><p>
<a class="anchor" name="c43f0672779cdb6cfb0141fcdcf603b6"></a><!-- doxytag: member="CS::DataBuffer::DataBuffer" ref="c43f0672779cdb6cfb0141fcdcf603b6" args="(char *iData, size_t iSize, bool should_delete=true)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Allocator = Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classCS_1_1DataBuffer.html">CS::DataBuffer</a>&lt; Allocator &gt;::<a class="el" href="classCS_1_1DataBuffer.html">DataBuffer</a>           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>iData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>iSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>should_delete</em> = <code>true</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Construct an data buffer object given a existing pointer. 
<p>
The pointer must be allocated by an allocator compatible to the given. 
<p>Definition at line <a class="el" href="databuf_8h-source.html#l00072">72</a> of file <a class="el" href="databuf_8h-source.html">databuf.h</a>.</p>

<p>References <a class="el" href="allocator_8h-source.html#l00365">CS::Memory::AllocatorPointerWrapper&lt; T, Allocator &gt;::p</a>.</p>

</div>
</div><p>
<a class="anchor" name="91837377d2c4f003b3fb54e558ab5ab8"></a><!-- doxytag: member="CS::DataBuffer::DataBuffer" ref="91837377d2c4f003b3fb54e558ab5ab8" args="(iDataBuffer *source)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Allocator = Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classCS_1_1DataBuffer.html">CS::DataBuffer</a>&lt; Allocator &gt;::<a class="el" href="classCS_1_1DataBuffer.html">DataBuffer</a>           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiDataBuffer.html">iDataBuffer</a>&lt; Allocator &gt; *&nbsp;</td>
          <td class="paramname"> <em>source</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Duplicate an existing data buffer. Also appends a 0 char. 
<p>

<p>Definition at line <a class="el" href="databuf_8h-source.html#l00080">80</a> of file <a class="el" href="databuf_8h-source.html">databuf.h</a>.</p>

<p>References <a class="el" href="structiDataBuffer.html#fa904d74bb662c7384fdfebf585fb4a1">iDataBuffer::GetData()</a>, and <a class="el" href="allocator_8h-source.html#l00365">CS::Memory::AllocatorPointerWrapper&lt; T, Allocator &gt;::p</a>.</p>

</div>
</div><p>
<a class="anchor" name="5878d572b0ec8e8309c89ec621acdb3d"></a><!-- doxytag: member="CS::DataBuffer::~DataBuffer" ref="5878d572b0ec8e8309c89ec621acdb3d" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Allocator = Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classCS_1_1DataBuffer.html">CS::DataBuffer</a>&lt; Allocator &gt;::~<a class="el" href="classCS_1_1DataBuffer.html">DataBuffer</a>           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroy (free) the buffer. 
<p>

<p>Definition at line <a class="el" href="databuf_8h-source.html#l00090">90</a> of file <a class="el" href="databuf_8h-source.html">databuf.h</a>.</p>

<p>References <a class="el" href="allocator_8h-source.html#l00365">CS::Memory::AllocatorPointerWrapper&lt; T, Allocator &gt;::p</a>.</p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a893a6cb4bd9809bbcbb15e51d9ed29d"></a><!-- doxytag: member="CS::DataBuffer::GetData" ref="a893a6cb4bd9809bbcbb15e51d9ed29d" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Allocator = Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual char* <a class="el" href="classCS_1_1DataBuffer.html">CS::DataBuffer</a>&lt; Allocator &gt;::GetData           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the buffer as an abstract pointer. 
<p>

<p>Definition at line <a class="el" href="databuf_8h-source.html#l00101">101</a> of file <a class="el" href="databuf_8h-source.html">databuf.h</a>.</p>

<p>References <a class="el" href="allocator_8h-source.html#l00365">CS::Memory::AllocatorPointerWrapper&lt; T, Allocator &gt;::p</a>.</p>

</div>
</div><p>
<a class="anchor" name="e5d6fcf7bb137d4cc1be7ecb9ef55707"></a><!-- doxytag: member="CS::DataBuffer::GetDeleteOnDestruct" ref="e5d6fcf7bb137d4cc1be7ecb9ef55707" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Allocator = Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classCS_1_1DataBuffer.html">CS::DataBuffer</a>&lt; Allocator &gt;::GetDeleteOnDestruct           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return true if this databuffer will destroy its memory on destruction. 
<p>

<p>Definition at line <a class="el" href="databuf_8h-source.html#l00108">108</a> of file <a class="el" href="databuf_8h-source.html">databuf.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="e549e5483eadac80d085dbe4b8a66cd3"></a><!-- doxytag: member="CS::DataBuffer::GetSize" ref="e549e5483eadac80d085dbe4b8a66cd3" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Allocator = Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual size_t <a class="el" href="classCS_1_1DataBuffer.html">CS::DataBuffer</a>&lt; Allocator &gt;::GetSize           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Query the buffer size. 
<p>

<p>Definition at line <a class="el" href="databuf_8h-source.html#l00097">97</a> of file <a class="el" href="databuf_8h-source.html">databuf.h</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>csutil/<a class="el" href="databuf_8h-source.html">databuf.h</a></ul>
<hr size="1"><address><small>Generated for Crystal Space 1.2.1 by 
<a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 
</small></address> </div></body> </html>