aboutsummaryrefslogtreecommitdiff
path: root/doc/oscl_html/oscl__error__allocator_8h_source.html
blob: c52cd6d0ea4441b203599a56faeb29e346531737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!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>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>oscl: oscl_error_allocator.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<h1>oscl_error_allocator.h</h1><a href="oscl__error__allocator_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- c++ -*-</span>
<a name="l00002"></a>00002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
<a name="l00003"></a>00003 
<a name="l00004"></a>00004 <span class="comment">//               O S C L _ E R R O R _ A L L O C A T O R</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
<a name="l00007"></a>00007 
<a name="l00019"></a>00019 <span class="preprocessor">#ifndef OSCL_ERROR_ALLOCATOR_H_INCLUDED</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_ERROR_ALLOCATOR_H_INCLUDED</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="comment">// - - Inclusion - - - - - - - - - - - - - - - - - - - - - - - - - - - -</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__base_8h.html" title="The file oscl_base.h is the public header that should be included to pick up the...">oscl_base.h</a>&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#endif</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef OSCL_BASE_MACROS_H_INCLUDED</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__base__macros_8h.html" title="This file defines common macros and constants for basic compilation support.">oscl_base_macros.h</a>&quot;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 <span class="preprocessor">#ifndef OSCLCONFIG_ERROR_H_INCLUDED</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="osclconfig__error_8h.html" title="This file contains the common typedefs and header files needed to compile osclerror...">osclconfig_error.h</a>&quot;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#endif</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a>00036 <span class="preprocessor">#ifndef OSCL_ASSERT_H_INCLUDED</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__assert_8h.html" title="The file oscl_assert.h provides an OSCL_ASSERT macro to document assumptions and...">oscl_assert.h</a>&quot;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#endif</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="preprocessor">#ifndef OSCL_DEFALLOC_H_INCLUDED</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__defalloc_8h.html" title="The file defines simple default memory allocator classes. These allocators are used...">oscl_defalloc.h</a>&quot;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#endif</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span>
<a name="l00044"></a>00044 
<a name="l00046"></a>00046 
<a name="l00049"></a><a class="code" href="classOsclErrorAllocator.html">00049</a> <span class="keyword">class </span><a class="code" href="classOsclErrorAllocator.html" title="This class provides static methods to invoke the user defined memory allocation routines...">OsclErrorAllocator</a>
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051     <span class="keyword">public</span>:
<a name="l00053"></a>00053 
<a name="l00056"></a><a class="code" href="classOsclErrorAllocator.html#ab5b7172c184a5190b1619c5b034cdbcf">00056</a>         <a class="code" href="classOsclErrorAllocator.html#ab5b7172c184a5190b1619c5b034cdbcf" title="constructor method">OsclErrorAllocator</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a>* <a class="code" href="classallocator.html">allocator</a>)
<a name="l00057"></a>00057         {
<a name="l00058"></a>00058             iAllocator = allocator;
<a name="l00059"></a>00059         }
<a name="l00061"></a>00061 
<a name="l00064"></a><a class="code" href="classOsclErrorAllocator.html#a872504e0c6cc0c124e3735fd63a2a41e">00064</a>         <span class="keyword">static</span> <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* <a class="code" href="classOsclErrorAllocator.html#a872504e0c6cc0c124e3735fd63a2a41e" title="static method to allocate a block of memory on heap">allocate</a>(uint32 aSize)
<a name="l00065"></a>00065         {
<a name="l00066"></a>00066             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(iAllocator != <a class="code" href="group__osclbase.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="The NULL_TERM_CHAR is used to terminate c-style strings.">NULL</a>);
<a name="l00067"></a>00067             <span class="keywordflow">return</span> iAllocator-&gt;ALLOCATE(aSize);
<a name="l00068"></a>00068         }
<a name="l00069"></a>00069 
<a name="l00071"></a>00071 
<a name="l00074"></a><a class="code" href="classOsclErrorAllocator.html#a69b74e3d21761004022b7ae93ca1e89b">00074</a>         <span class="keyword">static</span> <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a> <a class="code" href="classOsclErrorAllocator.html#a69b74e3d21761004022b7ae93ca1e89b" title="static method to deallocate a block of memory on heap">deallocate</a>(<a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* aPointer)
<a name="l00075"></a>00075         {
<a name="l00076"></a>00076             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(iAllocator != <a class="code" href="group__osclbase.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="The NULL_TERM_CHAR is used to terminate c-style strings.">NULL</a>);
<a name="l00077"></a>00077             iAllocator-&gt;<a class="code" href="classOscl__DefAlloc.html#a517d6b431b966f79a745e73d1a0a438f">deallocate</a>(aPointer);
<a name="l00078"></a>00078         }
<a name="l00079"></a>00079 
<a name="l00081"></a><a class="code" href="classOsclErrorAllocator.html#a4370e896db710ffee80dd3f79719d38f">00081</a>         <span class="keywordtype">void</span>* <a class="code" href="classOsclErrorAllocator.html#a4370e896db710ffee80dd3f79719d38f" title="placement new operator that allocates memory using the user defined methods">operator new</a>(uint32 size, <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* aPtr)
<a name="l00082"></a>00082         {
<a name="l00083"></a>00083             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(size);
<a name="l00084"></a>00084             <span class="keywordflow">return</span> aPtr;
<a name="l00085"></a>00085         }
<a name="l00086"></a>00086 
<a name="l00088"></a><a class="code" href="classOsclErrorAllocator.html#a304fea86c31b02870a509756e0e5aae1">00088</a>         <span class="keywordtype">void</span> <a class="code" href="classOsclErrorAllocator.html#a304fea86c31b02870a509756e0e5aae1" title="delete operator that doesn&amp;#39;t do anything, user has to deallocate manually">operator delete</a>(<a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* aPtr, <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* aPtr2)
<a name="l00089"></a>00089         {
<a name="l00090"></a>00090             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(aPtr);
<a name="l00091"></a>00091             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(aPtr2);
<a name="l00092"></a>00092         }
<a name="l00093"></a>00093 
<a name="l00094"></a>00094     <span class="keyword">private</span>:
<a name="l00095"></a>00095         <span class="keyword">static</span> <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a>* iAllocator;
<a name="l00096"></a>00096 };
<a name="l00097"></a>00097 
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 <span class="preprocessor">#endif  //OSCL_ERROR_ALLOCATOR_H_INCLUDED</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: CORE_9.004.1.1 </small>
</small></address>
</body>
</html>