blob: 183d4ef0b3effe45bbe3a5c060a80940698a3a0f [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>aligned_space.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<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><a href="annotated.html"><span>Classes</span></a></li>
<li id="current"><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="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul></div>
<h1>aligned_space.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> Copyright 2005-2010 Intel Corporation. All Rights Reserved.</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment"> The source code contained or described herein and all documents related</span>
<a name="l00005"></a>00005 <span class="comment"> to the source code ("Material") are owned by Intel Corporation or its</span>
<a name="l00006"></a>00006 <span class="comment"> suppliers or licensors. Title to the Material remains with Intel</span>
<a name="l00007"></a>00007 <span class="comment"> Corporation or its suppliers and licensors. The Material is protected</span>
<a name="l00008"></a>00008 <span class="comment"> by worldwide copyright laws and treaty provisions. No part of the</span>
<a name="l00009"></a>00009 <span class="comment"> Material may be used, copied, reproduced, modified, published, uploaded,</span>
<a name="l00010"></a>00010 <span class="comment"> posted, transmitted, distributed, or disclosed in any way without</span>
<a name="l00011"></a>00011 <span class="comment"> Intel's prior express written permission.</span>
<a name="l00012"></a>00012 <span class="comment"></span>
<a name="l00013"></a>00013 <span class="comment"> No license under any patent, copyright, trade secret or other</span>
<a name="l00014"></a>00014 <span class="comment"> intellectual property right is granted to or conferred upon you by</span>
<a name="l00015"></a>00015 <span class="comment"> disclosure or delivery of the Materials, either expressly, by</span>
<a name="l00016"></a>00016 <span class="comment"> implication, inducement, estoppel or otherwise. Any license under such</span>
<a name="l00017"></a>00017 <span class="comment"> intellectual property rights must be express and approved by Intel in</span>
<a name="l00018"></a>00018 <span class="comment"> writing.</span>
<a name="l00019"></a>00019 <span class="comment">*/</span>
<a name="l00020"></a>00020
<a name="l00021"></a>00021 <span class="preprocessor">#ifndef __TBB_aligned_space_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define __TBB_aligned_space_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "tbb_stddef.h"</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "tbb_machine.h"</span>
<a name="l00026"></a>00026
<a name="l00027"></a>00027 <span class="keyword">namespace </span>tbb {
<a name="l00028"></a>00028
<a name="l00030"></a>00030
<a name="l00032"></a>00032 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T,size_t N&gt;
<a name="l00033"></a><a class="code" href="a00142.html">00033</a> <span class="keyword">class </span><a class="code" href="a00142.html">aligned_space</a> {
<a name="l00034"></a>00034 <span class="keyword">private</span>:
<a name="l00035"></a>00035 <span class="keyword">typedef</span> __TBB_TypeWithAlignmentAtLeastAsStrict(T) element_type;
<a name="l00036"></a>00036 element_type array[(<span class="keyword">sizeof</span>(T)*N+<span class="keyword">sizeof</span>(element_type)-1)/<span class="keyword">sizeof</span>(element_type)];
<a name="l00037"></a>00037 <span class="keyword">public</span>:
<a name="l00039"></a><a class="code" href="a00142.html#0d702fc6b9e9d061ace3501b3c861cdf">00039</a> T* <a class="code" href="a00142.html#0d702fc6b9e9d061ace3501b3c861cdf">begin</a>() {<span class="keywordflow">return</span> reinterpret_cast&lt;T*&gt;(<span class="keyword">this</span>);}
<a name="l00040"></a>00040
<a name="l00042"></a><a class="code" href="a00142.html#024be075c23c0394c9a2518d993bcd9e">00042</a> T* <a class="code" href="a00142.html#024be075c23c0394c9a2518d993bcd9e">end</a>() {<span class="keywordflow">return</span> <a class="code" href="a00142.html#0d702fc6b9e9d061ace3501b3c861cdf">begin</a>()+N;}
<a name="l00043"></a>00043 };
<a name="l00044"></a>00044
<a name="l00045"></a>00045 } <span class="comment">// namespace tbb </span>
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="preprocessor">#endif </span><span class="comment">/* __TBB_aligned_space_H */</span>
</pre></div><hr>
<p></p>
Copyright &copy; 2005-2010 Intel Corporation. All Rights Reserved.
<p></p>
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
<p></p>
* Other names and brands may be claimed as the property of others.