#ifndef __POINT3D_H
#define __POINT3D_H
class IPoint3D{
public:
virtual void Print() const = 0;
virtual ~IPoint3D(){
}
};
class Point3D:public IPoint3D{
public:
int x,y,z;
Point3D(int x,int y,int z);
void Print()const;
};
extern "C"{
IPoint3D* CreatePoint3D(int x,int y,int z);
void DestroyPoint3D(IPoint3D* p);
typedef IPoint3D* (*create_t)(int,int,int);
typedef void (*destroy_t)(IPoint3D*);
}
#endif
#include "Point3D.h"
#include <iostream>
using namespace std;
Point3D::Point3D(int x,int y,int z):x(x),y(y),z(z){
}
void Point3D::Print()const{
cout << "(" << x << "," << y<<"," << z<< ")" << endl;
}
IPoint3D* CreatePoint3D(int x,int y,int z){
return new Point3D(x,y,z);
}
void DestroyPoint3D(IPoint3D* p){
delete p;
}
#include <iostream>
#