Concordia
substring_occurence.hpp
1 #ifndef SUBSTRING_OCCURENCE_HDR
2 #define SUBSTRING_OCCURENCE_HDR
3 
4 #include "concordia/common/config.hpp"
5 #include <string>
6 #include <iostream>
7 
17 public:
23 
28  explicit SubstringOccurence(const SUFFIX_MARKER_TYPE & marker);
29 
36  SubstringOccurence(const SUFFIX_MARKER_TYPE & id,
37  const SUFFIX_MARKER_TYPE & offset,
38  const SUFFIX_MARKER_TYPE & exampleLength);
41  virtual ~SubstringOccurence();
42 
46  SUFFIX_MARKER_TYPE getId() const {
47  return _id;
48  }
49 
53  SUFFIX_MARKER_TYPE getOffset() const {
54  return _offset;
55  }
56 
60  SUFFIX_MARKER_TYPE getExampleLength() const {
61  return _exampleLength;
62  }
63 
67  void enterDataFromMarker(const SUFFIX_MARKER_TYPE & marker);
68 
69  friend std::ostream & operator << (std::ostream & o,
70  const SubstringOccurence & occurence) {
71  return o << "occurence(exampleId=" << occurence.getId()
72  << ", offset=" << occurence.getOffset() << ")";
73  }
74 
75 
76 private:
77  SUFFIX_MARKER_TYPE _id;
78 
79  SUFFIX_MARKER_TYPE _offset;
80 
81  // the example
82  SUFFIX_MARKER_TYPE _exampleLength;
83 };
84 
85 #endif
void enterDataFromMarker(const SUFFIX_MARKER_TYPE &marker)
Definition: substring_occurence.cpp:13
Definition: substring_occurence.hpp:16
SUFFIX_MARKER_TYPE getOffset() const
Definition: substring_occurence.hpp:53
SUFFIX_MARKER_TYPE getExampleLength() const
Definition: substring_occurence.hpp:60
virtual ~SubstringOccurence()
Definition: substring_occurence.cpp:30
SubstringOccurence()
Definition: substring_occurence.cpp:4
SUFFIX_MARKER_TYPE getId() const
Definition: substring_occurence.hpp:46