node.cpp

来自「虚基类的实现」· C++ 代码 · 共 73 行

CPP
73
字号
// Node.cpp: implementation of the Node class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Node.h"
#include "Object.h"
#include<iostream>
using namespace std; 

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

Node::Node()
{
	info=NULL;
	link=NULL;

}

Node::~Node()
{
	cout<<"删除结点类"<<'\t';
	delete info;

}

void Node::InsertAfter(Node *p)
{
	p->link=link;
	link=p;

}

Node * Node::RemoveAfter()
{
	Node *tempP=link;
	if(link==NULL)
		tempP=NULL;
	else link=tempP->link;
	return tempP;

}

void Node::Linkinfo(Object *obj)
{
	
	info=obj;

}

Node * Node::getlink(void)
{
	return link;

}



void Node::setlink(Node *q)
{
	link=q;


}

Object * Node::getinfo(void)
{
	return info;

}

⌨️ 快捷键说明

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