#include "ProxyHeaders.hpp" // //############################################################################ //######################## IndexProxy ########################## //############################################################################ // IndexProxy::ClassData* IndexProxy::DefaultData = NULL; MemoryBlock* IndexProxy::AllocatedMemory = NULL; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void IndexProxy::InitializeClass() { Verify(!AllocatedMemory); AllocatedMemory = new MemoryBlock( sizeof(IndexProxy), 100, 100, "IndexProxy" ); Register_Object(AllocatedMemory); Verify(!DefaultData); DefaultData = new ClassData( IndexProxyClassID, "IndexProxy", GenericProxy::DefaultData ); Register_Object(DefaultData); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void IndexProxy::TerminateClass() { Unregister_Object(DefaultData); delete DefaultData; DefaultData = NULL; Unregister_Object(AllocatedMemory); delete AllocatedMemory; AllocatedMemory = NULL; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // IndexProxy::IndexProxy( ClassData *class_data, PolygonProxy *polygon, VertexProxy *index ): GenericProxy(class_data), polygonProxy(polygon), vertexProxy(index) { Check_Pointer(this); Check_Object(polygonProxy); polygonProxy->AttachIndexProxy(this); Check_Object(vertexProxy); vertexProxy->AttachIndexProxy(this); Check_Object(this); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // IndexProxy::IndexProxy( PolygonProxy *polygon, VertexProxy *index ): GenericProxy(DefaultData), polygonProxy(polygon), vertexProxy(index) { Check_Pointer(this); Check_Object(polygonProxy); polygonProxy->AttachIndexProxy(this); Check_Object(vertexProxy); vertexProxy->AttachIndexProxy(this); Check_Object(this); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // IndexProxy::~IndexProxy() { Check_Object(this); Check_Object(polygonProxy); polygonProxy->DetachIndexProxy(this); vertexProxy->DetachIndexProxy(this); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void IndexProxy::Destroy() { Check_Object(this); Verify(referenceCount == 1); DetachReference(); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void IndexProxy::TestInstance() const { Verify(IsDerivedFrom(DefaultData)); }