/*******************************************************************************
** Copyright (c) 1992-2025 MAK Technologies, Inc
** All rights reserved.
*******************************************************************************/
//! \file xml1516FileReader.h
//! \ingroup omtReader
#pragma once



#include <omtReader/omtReader.h>
#include <vlutil/vlString.h>

//! XML Tag Definitions
#include <mtl/xmlFedTags.h>
#include <mtl/fedReader.h>
#ifdef DtUSE_UTILITIES_NAMESPACE
namespace DtUSE_UTILITIES_NAMESPACE
{
#endif
class DtOMTTree;
class DtComplexComponentNode;
class DtEnumerationNode;
class DtAttributeFedNode;
class DtParameterFedNode;
class DtObjectClassFedNode;
class DtInteractionClassFedNode;
class DtFieldComponentNode;
class DtAlternativeComponentNode;
class DtExerciseConn;

class DT_DLL_OMTREADER DtXML1516FileReader
{

public: 

   //! constructor
   DtXML1516FileReader(DtExerciseConn* exConn);
   
   //! destructor
   virtual ~DtXML1516FileReader();

   virtual const DtString& getLastError();
   virtual void clearLastError();

   virtual DtOMTTree* processObjectModel(xmlNodePtr& ptr);

protected:
   virtual void processName(xmlAttrPtr& ptr, DtOMTTree*);
   virtual void processVersionNo(xmlAttrPtr& ptr, DtOMTTree*);
   virtual void processType(xmlAttrPtr& ptr, DtOMTTree*);
   virtual void processPurpose(xmlAttrPtr& ptr, DtOMTTree*);
   virtual void processApplicationDomain(xmlAttrPtr& ptr, DtOMTTree*);
   virtual void processSponsorOrgName(xmlAttrPtr& ptr, DtOMTTree*);
   virtual void processModificationDate(xmlAttrPtr& ptr, DtOMTTree*);
   virtual void processReference(xmlAttrPtr& ptr, DtOMTTree*);
   virtual void processOther(xmlAttrPtr& ptr, DtOMTTree*);


   virtual void processInteractions(xmlNodePtr& ptr, DtOMTTree*);
   virtual DtInteractionClassFedNode* processInteractionClass(xmlNodePtr& ptr, DtOMTTree*);
   virtual DtAttributeFedNode* processAttribute(xmlNodePtr& ptr, DtObjectClassFedNode* obj);
   virtual DtParameterFedNode* processParameter(xmlNodePtr& ptr, DtInteractionClassFedNode* inter);

   virtual void processObjects(xmlNodePtr& ptr, DtOMTTree*);
   virtual DtObjectClassFedNode* processObjectClass(xmlNodePtr& ptr, DtOMTTree*);

   virtual void processNotes(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processNote(xmlNodePtr& ptr, DtOMTTree*);

   virtual void processDatatypes(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processSimpleDatatypes(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processSimpleData(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processArrayDatatypes(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processArrayData(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processFixedDatatypes(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processFixedData(xmlNodePtr& ptr, DtOMTTree*);
   virtual DtFieldComponentNode* processField(xmlNodePtr& ptr);
   virtual void processBasicDataReps(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processBasicDataRep(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processVariantDatatypes(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processVariantData(xmlNodePtr& ptr, DtOMTTree*);
   virtual DtAlternativeComponentNode* processAlternative(xmlNodePtr& ptr);
   virtual void processEnumeratedDatatype(xmlNodePtr& ptr, DtOMTTree*);
   virtual DtEnumerationNode* processEnumeration(xmlNodePtr& ptr);
   virtual void processEnumerations(xmlNodePtr& ptr, DtOMTTree*);

   virtual void processSwitches(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processDimensions(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processDimension(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processTimeRepresentation(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processSynchronizations(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processSynchronization(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processTags(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processTag(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processTransportations(xmlNodePtr& ptr, DtOMTTree*);
   virtual void processTransportation(xmlNodePtr& ptr, DtOMTTree*);

   virtual const char* childNodeString(xmlAttrPtr& ptr);

protected:
   DtString myLastError;
   DtExerciseConn* myExConn;

private:
   
   //! Copy Constructor
   DtXML1516FileReader(const DtXML1516FileReader& orig);
   
   //! Assignment Operator
   DtXML1516FileReader& operator=(const DtXML1516FileReader& rhs);

   //! Setup the tree handles.
   void initializeHandles(DtOMTTree* omtTree);
   void setAttributeHandles(DtObjectClassFedNode* objNode);
   void setParameterHandles(DtInteractionClassFedNode* objNode);
};



#ifdef DtUSE_UTILITIES_NAMESPACE
} // end of namespace DtUSE_UTILITIES_NAMESPACE
#endif
