CStructureInterpreter.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef CStructureInterpreter_h
  2. #define CStructureInterpreter_h
  3. #include <map>
  4. #include <vector>
  5. #include <string>
  6. #include "CMethodInterface.h"
  7. #include "tinyxml2.h"
  8. namespace Chromium{
  9. class CStructureInterpreter
  10. {
  11. public:
  12. explicit CStructureInterpreter(const char* path);
  13. CMedthodInterface* getFunctionInterface(char* entityName, char* className, int methodID);
  14. std::vector<CMedthodInterface>* getAllMessageInterface(const char* entityName);
  15. private:
  16. // methods
  17. void getAllFiles();
  18. void loadXmlFiles();
  19. void loadEntityInterpreterFile();
  20. void parseXmlToMap(tinyxml2::XMLDocument& xml);
  21. void loadFunctionInterface(std::map<int,CMedthodInterface> &functionInterface, tinyxml2::XMLElement* pClass);
  22. void loadMessageInterface(std::vector<CMedthodInterface> &messageInterface, tinyxml2::XMLElement* pEntity);
  23. void loadParams(CTransStruct &params, tinyxml2::XMLElement* methodInterface);
  24. int convertStringToInt(std::string s);
  25. private:
  26. std::map<std::string, std::map<int,CMedthodInterface>> mMethodStructureMap;
  27. std::map<std::string, std::vector<CMedthodInterface>> mMessageStructureMap;
  28. std::string mPathOfXmls;
  29. std::vector<std::string> mFiles;
  30. };
  31. }
  32. #endif