list.cpp

来自「3D reconstruction, medical image process」· C++ 代码 · 共 72 行

CPP
72
字号
// List.cpp: implementation of the RxList class.////////////////////////////////////////////////////////////////////////#include "stdafx.h"#include "List.h"#ifdef _DEBUG#undef THIS_FILEstatic char THIS_FILE[]=__FILE__;#define new DEBUG_NEW#endif//////////////////////////////////////////////////////////////////////// Construction/Destruction//////////////////////////////////////////////////////////////////////ListItem::ListItem(short x, short y, short z){	this->x = x;	this->y = y;	this->z = z;}ListItem ListItem::operator =(const ListItem& li){	this->x = li.x;	this->y = li.y;	this->z = li.z;	return *this;}RxList::RxList(){	m_pList = NULL;	m_iHead = m_iTail = -1;	m_iSize = 0;}RxList::RxList(int iSize){	m_iSize = iSize;	m_pList = (ListItem*)::VirtualAlloc(NULL, sizeof(ListItem) * m_iSize, MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE);	m_iHead = m_iTail = -1;}RxList::~RxList(){	if (m_pList) {		::VirtualFree(m_pList, sizeof(ListItem) * m_iSize, MEM_DECOMMIT);		::VirtualFree(m_pList, 0, MEM_RELEASE);	}}void RxList::ClearAll(){	m_iHead = m_iTail = -1;}void RxList::SetSize(int iSize){	if (m_pList) {		::VirtualFree(m_pList, sizeof(ListItem) * m_iSize, MEM_DECOMMIT);		::VirtualFree(m_pList, 0, MEM_RELEASE);	}	m_iSize = iSize;	m_pList = (ListItem*)::VirtualAlloc(NULL, sizeof(ListItem) * m_iSize, MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE);	m_iHead = m_iTail = -1;}

⌨️ 快捷键说明

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