⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tc3d_allocator.h

📁 自己写的一些基本的3d引擎的基础的代码
💻 H
字号:
/**
 * Comet 3D Engine file (c) 2007 - 2008 Tianjie Wei, THSystems Research Group
 *
 * Released under BSD license, please refer to license.txt for more information
 */

#ifndef _TC3D_ALLOCATOR_H_
#define _TC3D_ALLOCATOR_H_

#include "TC3D_Policy.h"
#include "TC3D_Traits.h"

namespace C3D
{
	namespace Util
	{
		/**
		 * Standard memory allocator
		 *
		 * @Author Tianjie (James) Wei
		 * @Version 3.0
		 */
		template < class T, class TPolicy = TC3D_PolicyStd<T>,
			class TTraits = TC3D_Traits<T> >
		class TC3D_Allocator : public TPolicy, public TTraits
		{
			public:

				/**
				 * Convert TC3D_Allocator<T> to TC3D_Allocator<U>
				 */
				template < class U >
				struct Rebind
				{
					typedef TC3D_Allocator< U, typename TPolicy::template Rebind<U>::Other,
						typename TTraits::template Rebind<U>::Other > Other;
				};

			public:

				/**
				 * Default constructor
				 */
				inline explicit TC3D_Allocator()
				{
				}

				/**
				 * Copy constructor
				 */
				inline explicit TC3D_Allocator(const TC3D_Allocator &src) : 
					TTraits(src), TPolicy(src)
				{
				}

				/**
				 * TC3D_Allocator<U> copy constructor
				 */
				template < class U >
				inline TC3D_Allocator(const TC3D_Allocator<U> &src)
				{
				}

				/**
				 * TC3D_Allocator<U> copy constructor
				 */
				template < class U, class TPolicy2, class TTraits2 >
				inline TC3D_Allocator(const TC3D_Allocator<U, TPolicy2, TTraits2> &src) :
					TTraits(src), TPolicy(src)
				{

				}
		};
	};
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -