1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _LogFileScanner_h_
#define _LogFileScanner_h_

#include <string>
#include <cassert>
#include <iostream>
#include <fstream>
#include <list>
#include <set>
#include <map>
#include <vector>

class LogFileScanner
{
public:
  struct RepresentationData
  {
    RepresentationData() : valid(false) {}
    bool valid;
    std::vector<char> data;
  };

  //
  typedef std::map<std::string, RepresentationData > Frame;
  typedef std::list<unsigned int>::const_iterator FrameIterator;

public:
  LogFileScanner(const std::string& file);
  void readFrame(unsigned int currentFrame, Frame& frame);
  void open(const std::string& filePath);<--- Function 'LogFileScanner' argument 1 names different: declaration 'file' definition 'filePath'.

  const std::set<std::string>& getIncludedRepresentations() {
    return includedRepresentations;
  }

  FrameIterator begin() {
    return frames.begin();
  }

  FrameIterator end() {
    return frames.end();
  }

  FrameIterator last() {
    return --frames.end();
  }

private:
  void open_internal(const std::string& filePath);

  std::ifstream logFile;

  typedef std::map<unsigned int, std::streampos> FramesMap;
  FramesMap frameNumber2Pos;
  std::list<unsigned int> frames;

  // list of representation names included in the logfile
  std::set<std::string> includedRepresentations;

  void scanFile();
};

#endif //_LogFileScanner_h_