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

📄 tc3d_btree.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_BTREE_H_
#define _TC3D_BTREE_H_

#include "TC3D_Allocator.h"

namespace C3D
{
	namespace Util
	{
		/**
		 * Binary tree class template
		 *
		 * @Author Tianjie (James) Wei
		 * @Version 3.0
		 */
		template < class T, class TAlloc = TC3D_Allocator<T> >
		class TC3D_BTree
		{
			private:

				/**
				 * Binary tree node
				 */
				template < class T >
				struct SC3D_BTreeNode
				{
					SC3D_BTreeNode *pLeft;
					SC3D_BTreeNode *pRight;
					SC3D_BTreeNode *pParent;
					T tData;

					SC3D_BTreeNode()
					{
						pLeft	= DC3D_NULL;
						pRight	= DC3D_NULL;
						pParent	= DC3D_NULL;
					};

					SC3D_BTreeNode(const T &src)
					{
						pLeft	= DC3D_NULL;
						pRight	= DC3D_NULL;
						pParent	= DC3D_NULL;
						tData	= src;
					};
				};

			private:

				SC3D_BTreeNode<T> *pRoot;
				TAlloc tAllocator;
		
			public:

				class CC3D_IteratorPrefix
				{

				};

				class CC3D_IteratorInfix
				{

				};

				class CC3D_IteratorSufix
				{

				};

			public:

				TC3D_BTree()
				{
					pRoot	= DC3D_NULL;
				}

				TC3D_BTree(const TC3D_BTree<T> &src)
				{
					
				}

				virtual ~TC3D_BTree()
				{
					Clear();
				}

				virtual TC3D_Void Insert(const T &data)
				{
				
				}

				virtual TC3D_Void Delete(const T &data)
				{

				}

				virtual TC3D_Void Clear()
				{
					MC3D_SAFE_DELETE_SCALAR(pRoot);
				}

				/** Binary tree assignment operator */
				virtual TC3D_BTree<T> &operator = (const TC3D_BTree<T> &src)
				{
					if(this != &src)
					{

					}

					return *this;
				}

				/** Binary tree comparison operator */
				virtual TC3D_Bool &operator == (const TC3D_BTree<T> &src)
				{
					return DC3D_FALSE;
				}

				/** Binary tree comparison operator */
				virtual TC3D_Bool &operator != (const TC3D_BTree<T> &src)
				{
					return DC3D_FALSE;
				}
		};
	};
};

#endif

⌨️ 快捷键说明

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