/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #include "MGCLStdAfx.h" #include "mg/Gel.h" #include "mg/Attrib.h" #include "mg/Ifstream.h" #include "mg/Ofstream.h" #include "mg/Group.h" #if defined(_DEBUG) #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif using namespace std; // MGGel // Implementation of MGGel. //MGGel is an abstract class which represents a group element. //Gel is the abbreviation of group element. //Subclasses of MGGel are: //(1) MGAttribedGel, or (2) MGAttrib. //MGGel provides functions of serialization of objects. //All the objects of MGGel subclasses can be serialized using //MGGroup::make_file(), and MGGroup constructor. //Virtual Destructor MGGel::~MGGel(){;} //Construct a null newed MGGel from the type id TID. //Object handled by MGIfstream or MGOfstream is only the following objects. MGGel* MGNullGel(long TID){ long id=TID; id&=0xff000000; switch(id){ case MGOBJECT_TID: return MGNullObj(TID); case MGGROUP_TID: return MGNullGroup(TID); case MGATTRIB_TID: return MGNullAttrib(TID); //case MGATTRIBEDOBJ_TID:return MGNullAttribedObject(TID); } return 0; } bool MGGel::operator<(const MGGel& gel2)const{ long id1=identify_type(); long id2=gel2.identify_type(); return id1