|
core/NetworkParser.hGo to the documentation of this file.00001 //============================================================================ 00002 // Author : Alessandro Pinto <apinto@eecs.berkeley.edu> 00003 // University of California, Berkeley 00004 // 545 Cory Hall, Berkeley, CA 94720 00005 // Copyright : See COPYING file that comes with this distribution 00006 //============================================================================ 00007 00008 #ifndef NETWORKPARSER_H_ 00009 #define NETWORKPARSER_H_ 00010 00011 #include <string> 00012 #include <sstream> 00013 #include <map> 00014 #include <list> 00015 #include "IdGraph.h" 00016 #include "Factory.h" 00017 #include "tinyxml.h" 00018 00019 namespace cosi { 00020 00035 class NetworkParser { 00036 public: 00037 NetworkParser(string pFileName); 00038 virtual ~NetworkParser(); 00039 void Parse(); 00040 void Parse(TiXmlNode* pParent); 00041 IdGraph* GetNetwork(); 00042 00043 private: 00044 void ParseDocument(TiXmlNode* pParent); 00045 00046 // <Network> 00047 void ParseNetwork(TiXmlNode* pParent); 00048 void GetNetworkAttributes(TiXmlNode* pParent); 00049 00050 // <Node> 00051 void ParseNode(TiXmlNode* pParent); 00052 void GetNodeAttributes(TiXmlNode* pParent); 00053 00054 // <Link> 00055 void ParseLink(TiXmlNode* pParent); 00056 void GetLinkAttributes(TiXmlNode* pParent); 00057 00058 // <NodeLabel> 00059 void ParseNodeLabel(TiXmlNode* pParent); 00060 void GetNodeLabelAttributes(TiXmlNode* pParent); 00061 00062 // <NodeLabel> 00063 void ParseNodeMapLabel(TiXmlNode* pParent); 00064 //void GetNodeMapLabelAttributes(TiXmlNode* pParent); 00065 00066 void ParseLinkMapLabel(TiXmlNode* pParent); 00067 00068 // <Entry> node 00069 void ParseNodeMapEntry(TiXmlNode* pParent); 00070 void GetNodeMapEntryAttributes(TiXmlNode* pParent); 00071 00072 // <LinkLabel> 00073 void ParseLinkLabel(TiXmlNode* pParent); 00074 void GetLinkLabelAttributes(TiXmlNode* pParent); 00075 00076 // <Entry> link 00077 void ParseLinkMapEntry(TiXmlNode* pParent); 00078 void GetLinkMapEntryAttributes(TiXmlNode* pParent); 00079 00080 Factory* mF; 00081 string mFileName; 00082 string mNetworkType ; 00083 string mNetworkName ; 00084 00085 string mLabelName ; 00086 string mLabelFormat ; 00087 stringstream mLabelType ; 00088 list<string> mTypes ; 00089 00090 //Temporary storage 00091 map<string,Vertex> mNodes ; 00092 map<string,Edge> mLinks ; 00093 }; 00094 00095 } 00096 00097 #endif /*NETWORKPARSER_H_*/ Generated on Sun Sep 7 18:37:42 2008 for COSI by 1.5.4 |