VR-Link API Documentation for HLA 1.3
xmlFedReader1516e.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00005 
00006 #ifndef xmlFedReader1516e_H_
00007 #define xmlFedReader1516e_H_
00008 
00012 
00013 #include <stdio.h>
00014 #include <string>
00015 
00016 #include <vlutil/vlFedTarget.h>
00017 #include "fedReader.h"
00018 #include <vlutil/vlString.h>
00019 
00020 
00021 
00023 struct _xmlNode;
00024 struct _xmlDoc;
00025 typedef unsigned char xmlChar;
00026 typedef struct _xmlNode xmlNode;
00027 typedef struct _xmlDoc xmlDoc;
00028 
00029 #ifdef DtUSE_UTILITIES_NAMESPACE
00030 namespace DtUSE_UTILITIES_NAMESPACE
00031 {
00032 #endif
00033 
00038 class DT_DLL_MTL DtXmlFedReader1516e : public DtFedReader
00039 {
00040 public:
00041 
00043    DtXmlFedReader1516e();
00044 
00046    virtual ~DtXmlFedReader1516e();
00047 
00048 private:
00049 
00051    DtXmlFedReader1516e( const DtXmlFedReader1516e& );
00052    DtXmlFedReader1516e& operator=( const DtXmlFedReader1516e& );
00053 
00054 public:
00055 
00058    virtual DtFedReadStatus readFedFilePtr(FILE* filePointer, DtFedTarget *fedTarget, 
00059       DtFilename fileName, bool strictCheckingEnabled=false, bool useDTD=false, bool dontParseSwitches=false );
00060 
00062    virtual void setSchemaValidationEnabled(bool enabled);
00063 
00064 protected:
00065 
00067    virtual bool schemaValidate(xmlDoc* pDoc, const char * schemaFile);
00068 
00070    virtual DtFedReadStatus openFile(const char *fedFileName,
00071                                     xmlDoc  **newXmlDocTree);
00072 
00074    static xmlNode* getNodeByName( xmlNode* currentNode,
00075                                    const xmlChar* nodeName );
00077    virtual DtFedReadStatus processFed( xmlNode* fedObj );
00078    
00080    virtual DtFedReadStatus parseTransportationsList( xmlNode* currentNode );
00081 
00083    virtual DtFedReadStatus processObjects( xmlNode* currentNode );
00084 
00086    virtual DtFedReadStatus processInteractions( xmlNode* currentNode );
00087 
00089    virtual DtFedReadStatus parseObjectTree( xmlNode* currentNode,
00090                                             const DtString& parentName );
00091 
00093    virtual DtFedReadStatus parseAttribute( xmlNode* currentNode,
00094                                            const DtString& parentName );
00095 
00097    virtual DtFedReadStatus parseAttributeDimensions( xmlNode* currentNode,
00098       DtString const& objectClass, DtString const& attribute);
00099 
00101    virtual DtFedReadStatus parseInteractionTree( xmlNode* currentNode,
00102                                                  const DtString& parentName );
00103 
00105    virtual DtFedReadStatus parseInteractionDimensions( xmlNode *currentNode,
00106       DtString const& interactionClass );
00107 
00109    virtual DtFedReadStatus parseDimensionList( xmlNode* currentNode );
00110 
00112    virtual DtFedReadStatus parseDimension( xmlNode* currentNode );
00113 
00115    virtual DtFedReadStatus parseSwitches( xmlNode* currentNode );
00116 
00118    virtual DtFedReadStatus parseUpdateRates( xmlNode* currentNode );
00119 
00121    virtual DtFedReadStatus parseParameter( xmlNode* currentNode,
00122                                            const DtString& parentName );
00123 
00125    virtual DtFedReadStatus parseTransportationTree( xmlNode* currentNode );
00126 
00128    virtual DtFedReadStatus parseDataTypeTree( xmlNode* currentNode );
00129 
00131    virtual DtFedReadStatus parseNotesTree( xmlNode* currentNode );
00132 
00134    virtual DtFedReadStatus parseTagsTree( xmlNode* currentNode );
00135 
00137    virtual DtFedReadStatus parseBasicDataTypesTree( xmlNode* currentNode );
00138 
00140    virtual DtFedReadStatus parseSimpleDataTypesTree( xmlNode* currentNode );
00141 
00143    virtual DtFedReadStatus parseArrayDataTypesTree( xmlNode* currentNode );
00144 
00146    virtual DtFedReadStatus parseEnumeratedDataTypesTree( xmlNode* currentNode );
00147 
00149    virtual DtFedReadStatus parseFixedRecordDataTypesTree( xmlNode* currentNode );
00150 
00152    virtual DtFedReadStatus parseVariantRecordDataTypesTree( xmlNode* currentNode );
00153 
00155    virtual void appendNodeProperties( xmlNode* currentNode, DtString& output ) const;
00156 
00158    virtual void appendNodeContent(xmlNode*  node, DtString& output) const;
00159 
00161    virtual bool isBlankText(xmlNode*  node) const;
00162 
00164    virtual const xmlChar* propertyByName( xmlNode* node, const xmlChar *name);
00165 
00169    virtual bool getPropertyByName( xmlNode* node, const xmlChar *name,
00170       DtString& propertyContent);
00171 
00173    static const xmlChar* childContentByName( xmlNode* node, const xmlChar *name) ;
00174 
00178    virtual bool getChildContentByName( xmlNode* node, const xmlChar *name,
00179       DtString& childContent);
00180 
00182    virtual DtFedReadStatus getTransportType( xmlNode* currentNode,
00183                                              DtTransportType& transportType );
00184 
00186    virtual DtFedReadStatus getOrderType( xmlNode* currentNode,
00187                                          DtOrderType& orderType );
00188 
00189    bool convertStringToULong(std::string numericString,
00190       unsigned long& value);
00191 #ifdef __sgi__
00192    void clipPrefix(std::string& valueSpec, char c);
00193 #else
00194    template<typename operandType> void clipPrefix(std::string& valueSpec,
00195       operandType c);
00196 #endif
00197 
00198 public:
00199 
00200    static bool isEvolvedFormat(void* fedFilePtr);
00201 
00202 protected:
00203 
00204    DtFedTarget* myFedTarget;
00205 
00206    // Whether or not schema validation should be performed
00207    bool mySchemaValidationEnabled;
00208 
00209 };
00210 
00211 #ifdef DtUSE_UTILITIES_NAMESPACE
00212 } 
00213 #endif
00214 
00215 #endif  //! xmlFedReader1516e_H_
00216 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)