SHARE
TWEET

pp

a guest Jan 22nd, 2020 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. #include "LogReader.h"
  4. #include "Request.h"
  5.  
  6. using namespace std;
  7.  
  8. const int TOP = 10;
  9.  
  10. int main(int argc, char* argv[]){
  11.     string logFile;
  12.     bool graph;
  13.     string graphFile;
  14.     bool noim;
  15.     bool timing;
  16.     unsigned time;
  17.     unsigned i = 1;
  18.     while(i<argc)
  19.     {
  20.         if(argv[i]== "-g")
  21.         {
  22.             graph = true;
  23.             i++;
  24.             graphFile = argv[i];
  25.         }
  26.         else if(argv[i]== "-e")
  27.         {
  28.             noim = true;
  29.         }
  30.         else if(argv[i]== "-t")
  31.         {
  32.             timing = true;
  33.             i++;
  34.             time = atoi(argv[i]);
  35.         }
  36.         else
  37.         {
  38.             //todo
  39.         }
  40.         i++;
  41.     }
  42.     logFile = string(argv[i]);
  43.     std::vector<Request> tab;
  44.     LogReader::ReadFile(logFile, tab);
  45.     Catalog c;
  46.     if(graph)
  47.     {
  48.         c.FillGraphEdges(tab);
  49.         GraphGenerator::GenerateGraph(c, graphFile);
  50.     }
  51.     else
  52.     {
  53.         c.FillHitsPerTarget(tab);
  54.         c.ConvertMapToMultimap();
  55.         RankingDisplayer::DisplayTopHits(c, TOP);
  56.     }
  57.  
  58.     return 0;
  59. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top