All pastes #885702 Raw Edit

Mine

public cpp v1 · immutable
#885702 ·published 2008-01-31 01:50 UTC
rendered paste body
#ifndef ENTITY_H#define ENTITY_Hclass SceneGraph;class Entity {  public:	virtual void deleteE(SceneGraph* e);};#endif>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#ifndef SCENEGRAPH_H#define SCENEGRAPH_H#include <string>using namespace std;class Entity;class SceneGraph {  public:	void deleteE(Entity* e);	void print(string s);};#endif>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#ifndef SPECIALENTITY_H#define SPECIALENTITY_H#include "Entity.h"class SpecialEntity: public Entity {  public:	virtual void deleteE(SceneGraph* e);};#endif>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#include "Entity.h"#include "SceneGraph.h"void Entity::deleteE(SceneGraph* graph) {	graph->print("entity::delete()");}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#include "SceneGraph.h"#include "Entity.h"#include <string>#include <iostream>void SceneGraph::deleteE(Entity* e) {	e->deleteE(this);}void SceneGraph::print(string s) {	cout << s << "\n";}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#include "SpecialEntity.h"#include "SceneGraph.h"void SpecialEntity::deleteE(SceneGraph* graph) {	graph->print("SpecialEntity::delete()");}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#include "SceneGraph.h"#include "Entity.h"#include "SpecialEntity.h"int main() {	Entity e;	SpecialEntity f;	SceneGraph* graph = new SceneGraph();	graph->deleteE(&e);	graph->deleteE(&f);}