Esempio n. 1
0
void CMyDateEdit::SetDefault()
{
 if (m_isDate)
  SetClassType(edit_date);
 else if (m_isTime)
  SetClassType(edit_time);
 else if (m_isDateTime)
 SetClassType(edit_datetime);
}
HashTable<T>::HashTable(int nSize)
{
	SetClassType(DATA_STRUCT);
	SetTitle("Data Struct: Hash Table");
	unsigned int i = sizeof(gPrimeTable)/sizeof(int) - 1;
	for(i; i >= 0;--i)
	{
		if(gPrimeTable[i]>m_nSize)
		{
			continue;
		}
		else
		{
			break;
		}
	}
	m_nSize = gPrimeTable[++i];
	m_m1 = m_nSize;
	m_m2 = m_nSize - 1;
	m_nCur = 0;
	try
	{
		m_ppArray = new T*[m_nSize];
		for(int j=0;j<m_nSize;j++)
			m_ppArray[j] = NULL;
	}
	catch(...)
	{
		TRACE("new failure!");
	}
}
BinarySearchTree<T>::BinarySearchTree(Compare pFun)
{
	SetClassType(DATA_STRUCT);
	SetTitle("Data Struct: Binary Search Tree");
	m_pRoot = NULL;
	m_pFun = pFun;
}
BinarySearchTree<T>::BinarySearchTree()
{
	SetClassType(DATA_STRUCT);
	SetTitle("Data Struct: Binary Search Tree");
	m_pRoot = NULL;
	m_pFun = DefaultCompare<T>;
}
Esempio n. 5
0
CActor::CActor(std::string ObjName) : CTickableObject(ObjName)
{
    PRINT( (LS_Debug | LS_Objects), "CActor Constructor BEGIN" );
    SetClassType(OC_Actor);

	mLocation = glm::vec3();
    mRotation = CRotator();
    mScale = 1.f;

    RecalculateTransformMatrix();

    PRINT( (LS_Debug | LS_Objects), "CActor Constructor END" );
}
ListStack<T>::ListStack()
{
	SetClassType(DATA_STRUCT);
	SetTitle("Data Struct: Stack Implemented By List");
	try
	{
		m_pHead = new ListNode<T>[1];
	}
	catch(...)
	{
		TRACE("new failure!");
		m_pHead = NULL;
		return;
	}
	m_pHead->pNext = NULL;
	m_pTop = m_pHead;
	m_nSize = 0;
}
CycleDoublyLinkList<T>::CycleDoublyLinkList()
{
	SetClassType(DATA_STRUCT);
	SetTitle("Data Struct: Stack Implemented By List");
	try
	{
		m_pSentinel = new CDListNode<T>[1];
	}
	catch(...)
	{
		TRACE("new failure!");
		m_pSentinel = NULL;
		return;
	}
	m_pSentinel->pNext = m_pSentinel;
	m_pSentinel->pPrev = m_pSentinel;
	m_nSize = 0;
}
HashTable<T>::HashTable()
{
	SetClassType(DATA_STRUCT);
	SetTitle("Data Struct: Hash Table");
	m_nSize = 13;
	m_m1 = m_nSize;
	m_m2 = m_nSize - 1;
	m_nCur = 0;
	try
	{
		m_ppArray = new T*[m_nSize];
		for(int j=0;j<m_nSize;j++)
			m_ppArray[j] = NULL;
	}
	catch(...)
	{
		TRACE("new failure!");
	}
}