Ejemplo n.º 1
0
Archivo: tree.c Proyecto: why0603/angel
void IterationProcessNode(TreePtr tree,TreeNodePtr node,NodeCallBack fnNode)
{
	unsigned long i;
	TreeNodePtr left = NULL;
	TreeNodePtr right = NULL;
	ArrayPtr nodeList = CreateArray(tree->size,sizeof(void*));
	InsertArray(nodeList,&node);
	for (i=0; i<nodeList->size; i++)
	{
		node = *(TreeNodePtr*)GetDataArray(nodeList,i);
		left = node->left;
		right = node->right;
		if (NULL != fnNode)
		{
			fnNode(tree,node);
		}
		if (NULL != left)
		{
			InsertArray(nodeList,&left);
		}
		if (NULL != right)
		{
			InsertArray(nodeList,&right);
		}
	}
	DestroyArray(nodeList);
}
Ejemplo n.º 2
0
// Private Operations
void CQuakePacket::MergeBuffer(CQuakePacket& rOther, const WORD& nInsertPoint)
{
	GetDataArray().InsertAt(nInsertPoint, &rOther.GetDataArray());
	if (m_nPosition >= nInsertPoint)
	{
		m_nPosition += rOther.GetSize();
	}
}
Ejemplo n.º 3
0
	void CQuakePacket::RemoveData(const WORD& nPosition, const WORD& nLength)
	{
		ASSERT(nPosition < GetSize());
		if (m_nPosition > nPosition)
		{
			if (nLength > m_nPosition)
			{
				m_nPosition = 0;
			}
			else
			{
				m_nPosition -= nLength;
			}
		}
		GetDataArray().RemoveAt(nPosition, nLength);
	}
Ejemplo n.º 4
0
/**
 * Get a data array covering the full range of data.
 * NOTE: The calling code is responsible for deleting the DataArray that is
 * returned, when it is no longer needed.
 *
 * @param is_log_x  Flag indicating whether or not the data should be
 *                  binned logarithmically.  This DataSource does not 
 *                  support rebinning to a log axis, so the DataArray is 
 *                  always returned with is_log_x = false.
 */
DataArray * ArrayDataSource::GetDataArray( bool is_log_x )
{
  is_log_x = false;
  return GetDataArray( total_xmin, total_xmax, total_ymin, total_ymax,
                       total_rows, total_cols, is_log_x );
}
Ejemplo n.º 5
0
	void CQuakePacket::PutByte(const BYTE& nData)
	{
		ASSERT(GetReadMode() == FALSE);
		GetDataArray().SetAtGrow(m_nPosition++, nData);
	}
Ejemplo n.º 6
0
	BYTE CQuakePacket::GetByte()
	{
		ASSERT(GetReadMode() == TRUE);
		ASSERT(GetPosition() < GetDataArray().GetSize());
		return GetDataArray().GetAt(m_nPosition++);
	}
Ejemplo n.º 7
0
/**
 *  Convenience method to get all the data at the maximum resolution.
 */
DataArray* ImageDataSource::GetDataArray( bool is_log_x )
{
  return GetDataArray( total_xmin, total_xmax, total_ymin, total_ymax,
                       total_rows, total_cols, is_log_x );
}