Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

/home/pauldt/projects/IDEA/IDEA-ALL/IDEA-DEV/Modules/Xerces/ModelLoader/Includes/XercesModelLoader.hh

Go to the documentation of this file.
00001 // -*- Mode: c++ -*-
00002 //     File: $Source: /home/cvs/ISG-Repository/IDEA-DEV/Modules/Xerces/ModelLoader/Includes/XercesModelLoader.hh,v $
00003 //      Tag: $Name: DR_01_11_06 $
00004 //      CVS: $Id: XercesModelLoader.hh,v 1.3 2005/12/30 22:46:06 rijsman Exp $
00005 //     Info: $CVSROOT/IDEA-DEV/COPYRIGHT
00006 
00007 #ifndef XERCES_MODEL_LOADER_IMPL_HEADER_
00008 #define XERCES_MODEL_LOADER_IMPL_HEADER_
00009 
00010 #include "PslArgumentTypes.hh"
00011 #include "XIDDLModelLoader.hh"
00012 
00013 #include "xercesc/dom/DOM.hpp"
00014 #include <xercesc/parsers/XercesDOMParser.hpp>
00015 
00016 XERCES_CPP_NAMESPACE_USE
00017 
00018 namespace IDEA
00019 {
00020   class AgentRelay;
00021   class PslDatabase;
00022   class PslPredicate;
00023   
00029   class XercesModelLoader:
00030     public XIDDLModelLoader
00031   {
00032   public:
00036     XercesModelLoader();
00040     ~XercesModelLoader();
00044     bool loadModel( const PslDatabase* database,
00045                     const AgentRelay* agentRelay,
00046                     const std::string& model );
00050     bool getAgentName( const std::string& model, std::string& name );
00054     bool getTimeUnit( const std::string& agentName, const std::string& model, Granularity& granulity );
00058     bool getLatency( const std::string& agentName, const std::string& model, Time& latency );
00059   private:
00060     XercesDOMParser* m_Parser;
00061 
00062     bool parseModel( const std::string& model );
00063 
00064     bool initializeParser();
00065 
00066     void parseAgent( DOMElement* node  );
00067     bool parseAgent( DOMDocument* document );
00071     int parseCallArguments( DOMElement* node, int index, const PslPredicate* predicate );
00072     void parseObjects( DOMDocument* document );
00073     void parseChildByTag( DOMElement* node, const std::string& tag, int index, std::string& value );
00074     void parseDefineProcedure( DOMElement* node );
00075     void parseDefineMemberValues( DOMElement* node );
00076     void parseDurationConstant( DOMElement* node ); 
00077     void parseInitialCommunicationChannels( DOMElement* node ); 
00078     void parseInitialSubSystems( DOMElement* node ); 
00082     int parseInternalModes( DOMElement* node, int index, const PslPredicate* predicate );
00083     void parseInternalProcess( DOMElement* node );
00084     void parseLabelSet( DOMElement* node );
00085     void parseNameChild( DOMElement* node, std::string& name );
00086     void parseNumericConstant( DOMElement* node );
00087     void parseObjectClass( DOMElement* node );
00088     void parseProcedures( DOMDocument* document );
00092     int parseReturnArguments( DOMElement* node, int index, const PslPredicate* predicate );  
00096     int parseReturnStatus( DOMElement* node, int index, const PslPredicate* predicate );
00097     void parseSubSystem( DOMElement* node );
00098 
00099     void parseTypeRangeNameArgument( DOMElement* elementNode, 
00100                                      const PslPredicate* predicate,
00101                                      int index, 
00102                                      const PslArgumentType& argType,
00103                                      const PslSelectorType& modeType );
00109     void parseTypeRangeNameFlagArgument( DOMElement* node, 
00110                                         const PslPredicate* predicate,
00111                                         int index, 
00112                                         const PslArgumentType& type, 
00113                                         const PslArgumentType& flagType );
00114 
00115 
00116     void parseValueChild( DOMElement* node, double& value );
00117 
00118     bool getTextValue( DOMNode* node, std::string& value ) const;
00119     bool getRealValue( DOMNode* node, double& value ) const;
00120 
00121     // temporary variables 
00122     const PslDatabase* m_Database;
00123     const AgentRelay* m_AgentRelay;
00124     
00125   };
00126 }
00127 
00128 #endif // XERCES_MODEL_LOADER_IMPL_HEADER_

Contact information
© IDEA
Generated on Fri Feb 3 17:09:42 2006 for IDEA.