Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.53 KB | None | 0 0
  1. #ifndef LINE2DATA_H
  2. #define LINE2DATA_H
  3.  
  4. #include <string>           //strings
  5. #include <vector>           //vectors
  6. #include <set>
  7. #include <unordered_set>
  8. #include <unordered_map>
  9. #include "../EntityHandler/EntityHandler.h"
  10.  
  11.  
  12.  
  13. class line2data
  14. {
  15.     public:
  16.         //MEMBER VARIABLES
  17.         //id of the thread
  18.         size_t parentID;
  19.  
  20.         //contains the current entity string (which gets created character by character)
  21.         std::string stepLine;
  22.  
  23.         //DEBUG/STATISTICS
  24.         //this set contains all Ifclabels that will be found during the parsing
  25.         std::set<std::string> LINELabels;
  26.  
  27.         //CON-/DESTRUCTORS
  28.         line2data();
  29.         ~line2data();
  30.  
  31.         //METHODS
  32.         void parseBlock(std::vector<std::string>);
  33.  
  34.  
  35.     private:
  36.         //MEMBER VARIABLES
  37.         EntityHandler entityHandler;
  38.         //used to identify needed line entities
  39.         bool interesting = false;
  40.         //used to identity needed parameters within needed line entities
  41.         std::vector<int8_t> interestingPositions;
  42.         //used to map strings onto enums (for switch use)
  43.         std::unordered_map<std::string, eLINEEntities> interestingEntities;
  44.         //stores needed/interesting entities
  45.         std::unordered_map<std::string, std::unique_ptr<classPtr>> foundEntities;
  46.         //current entity id string used for index access
  47.         std::string currentIndex = "";
  48.         //
  49.         //std::unordered_map<std::string, classPtr>
  50.         int entities = 0;
  51.         const char * cursorPosition;
  52.  
  53.         //METHODS
  54.         //parse line
  55.         void parseLine();
  56.         //iterates over a string, positioning cursor at the end (captures string in the process)
  57.         void parseEntityParameters();
  58.         //handles strings properly
  59.         void handleStrings();
  60.         //get line id and position properly
  61.         std::string getId();
  62.         //get line entity and position properly
  63.         std::string getEntity();
  64.         //handles line entity parameters
  65.         size_t handleEntityParameters();
  66.         //gets the complete string (from ' till ')
  67.         std::string finalizeString(bool);
  68.         //get the complete number as string (all digits +1x occurence of a dot)
  69.         std::string finalizeInt();
  70.         //get the complete ENUM data as string
  71.         std::string finalizeEnum();
  72.         //get set of something as a string (everything except sets of references)
  73.         std::string finalizeSet(size_t);
  74.         //finalize line subentity
  75.         std::string finalizeIfcSubentity();
  76. };
  77. #endif // LINE2DATA_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement