KSquare Utilities
StartStopPoint.h
Go to the documentation of this file.
1 #if !defined(_STARTSTOPPOINT_)
2 #define _STARTSTOPPOINT_
3 
4 #include <vector>
5 
6 #include "DateTime.h"
7 #include "GoalKeeper.h"
8 #include "KKStr.h"
9 #include "KKStrParser.h"
10 
11 using namespace KKB;
12 
13 
14 namespace KKLSC
15 {
16  #if !defined(_SCANNERFILE_)
17  class ScannerFile;
18  typedef ScannerFile* ScannerFilePtr;
19  #endif
20 
23 
24 
25  /**
26  *@brief Class that keeps track of parameter details of a single scanner file.
27  */
29  {
30  public:
32 
33  enum class StartStopType: int
34  {Null,
35  StartPoint,
36  StopPoint,
37  Invalid
38  };
39  static const KKStr& StartStopTypeToStr (StartStopType t);
40 
41  static StartStopType StartStopTypeFromStr (const KKStr& s);
42 
43  StartStopPoint (kkint32 _scanLineNum,
44  StartStopType _type
45  );
46 
47  StartStopPoint (const StartStopPoint& entry);
48 
49  StartStopPoint (const KKStr& s);
50 
51  ~StartStopPoint ();
52 
54 
55  // Access Methods
56  kkint32 ScanLineNum () const {return scanLineNum;}
57  StartStopType Type () const {return type;}
58  const KKStr& TypeStr () const {return StartStopTypeToStr (type);}
59 
60  void ScanLineNum (const kkint32 _scanLineNum) {scanLineNum = _scanLineNum;}
61  void Type (StartStopType _type) {type = _type;}
62 
63  KKStr ToTabDelStr () const;
64  void ParseTabDelStr (KKStr parser);
65 
66  private:
67  static KKStr startStopPointStrs [];
68  static StartStopType startStopPointTypes[];
69 
70  kkint32 scanLineNum;
71  StartStopType type;
72  }; /* StartStopPoint */
73 
74 
75  typedef StartStopPoint::StartStopPointPtr StartStopPointPtr;
76 
77 
78 
80  {
81  public:
83 
86 
88 
89  StartStopPointPtr AddEntry (kkint32 _scanLineNum,
91  );
92 
93  StartStopPointPtr AddEntry (StartStopPointPtr& _entry);
94 
95  void Clear (); /**< Clears all existing entries. */
96 
97  void DeleteEntry (kkint32 _scanLineNum);
98 
99  StartStopPointPtr NearestEntry (kkint32 _scanLineNum) const;
100 
101  StartStopPointPtr PrevEntry (kkint32 _scanLineNum) const;
102 
103  StartStopPointPtr SuccEntry (kkint32 _scanLineNum) const;
104 
105  private:
106  kkint32 FindEqual (kkint32 _scanLineNum) const;
107  kkint32 FindGreaterOrEqual (kkint32 _scanLineNum) const;
108  kkint32 FindLessOrEqual (kkint32 _scanLineNum) const;
109 
110  iterator idx;
111  }; /* StartStopPointList */
112 
113 
115 
116 
117 
118 
119  /**@brief Defines a single region in a Scanner File that is to be included in a count */
121  {
122  public:
123  StartStopRegion (kkint32 _start,
124  kkint32 _end
125  );
126 
127  kkint32 Start () const {return start;}
128  kkint32 End () const {return end;}
129 
130  private:
131  kkint32 start;
132  kkint32 end;
133  };
134 
136 
137 
139  {
140  public:
141  StartStopRegionList (bool _owner);
142 
143  StartStopRegionList (const StartStopPointList& startStopPoints);
144 
146  };
147 
149 
150 }; /* KKLSC */
151 
152 #endif
kkint32 End() const
StartStopRegionList * StartStopRegionListPtr
static const KKStr & StartStopTypeToStr(StartStopType t)
__int32 kkint32
Definition: KKBaseTypes.h:88
KKStr ToTabDelStr() const
kkint32 Start() const
StartStopPointList * StartStopPointListPtr
void DeleteEntry(kkint32 _scanLineNum)
StartStopRegion * StartStopRegionPtr
kkint32 ScanLineNum() const
StartStopRegionList(const StartStopPointList &startStopPoints)
StartStopRegion(kkint32 _start, kkint32 _end)
StartStopPointPtr PrevEntry(kkint32 _scanLineNum) const
KKTHread * KKTHreadPtr
StartStopPointPtr SuccEntry(kkint32 _scanLineNum) const
StartStopPointList * StartStopPointListPtr
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of &#39;std::string&#39; strings.
Definition: KKStr.cpp:1082
void ParseTabDelStr(KKStr parser)
StartStopPoint(kkint32 _scanLineNum, StartStopType _type)
Contains Classes that are specific to Cameras physical characteristics.
StartStopType Type() const
Defines a single region in a Scanner File that is to be included in a count.
static StartStopType StartStopTypeFromStr(const KKStr &s)
StartStopPointPtr AddEntry(kkint32 _scanLineNum, StartStopPoint::StartStopType _type)
kkint32 MemoryConsumedEstimated() const
void ScanLineNum(const kkint32 _scanLineNum)
StartStopPointPtr NearestEntry(kkint32 _scanLineNum) const
StartStopPoint(const KKStr &s)
StartStopPoint * StartStopPointPtr
StartStopPointPtr AddEntry(StartStopPointPtr &_entry)
kkint32 MemoryConsumedEstimated() const
void Type(StartStopType _type)
const KKStr & TypeStr() const
StartStopPoint(const StartStopPoint &entry)
Class that keeps track of parameter details of a single scanner file.