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

📄 stockdatalist.cpp

📁 这是一个股票系统
💻 CPP
字号:
// StockDataList.cpp: implementation of the CStockDataList class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "STU3901070115.h"
#include "StockDataList.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CStockDataList::CStockDataList()
{

}

CStockDataList::~CStockDataList()
{

}

POSITION CStockDataList::AddSorted(CStockData &sdToAdd, errorstatus &err, POSITION pos)
{
	err = ok;

	if( !pos )
	{
		pos = GetHeadPosition();

		if (!pos) // empty list
			return AddHead( sdToAdd );
	}

	while( pos )
	{
		POSITION insertPos = pos;

		CStockData sdCurrent = GetNext( pos );

		if( sdToAdd == sdCurrent)
		{ err = duplicate_entry; return NULL; }

		if( sdToAdd.IsConflictingEntry( sdCurrent ))
		{ err = conflicting_entry; return insertPos; }
		
		if( sdToAdd < sdCurrent)
		{
			POSITION posTemp =
				InsertBefore( insertPos, sdToAdd );
			if( !posTemp ) err = fail;
			return posTemp;
		}
	} 
	
	// If we got here then add to the end of the list
	return AddTail( sdToAdd );

}
template <> void AFXAPI SerializeElements<CStockData>
		(CArchive& ar, CStockData* pNewSD, int nCount)
		{
			for(int i=0; i<nCount;i++,pNewSD++)
			{
				pNewSD->Serialize(ar);
			}
		}

⌨️ 快捷键说明

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