JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
IDPositionOrigin.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 09/05/2019.
3 //
4 
5 #ifndef JODA_IDPOSITIONORIGIN_H
6 #define JODA_IDPOSITIONORIGIN_H
7 
9 
10 #include "IOrigin.h"
11 
16 class IDPositionOrigin : public IOrigin {
17  public:
19  IDPositionOrigin(FILEID id, long start, long end, int index);
20  std::unique_ptr<RJDocument> reparse(RJMemoryPoolAlloc &alloc) const override;
21  bool isReparsable() const override;
22  virtual ~IDPositionOrigin() override = default;
23 
24  long getStart() const;
25  void setStart(long start);
26  long getEnd() const;
27  void setEnd(long end);
28  int getIndex() const;
29  void setIndex(int index);
30 
35  virtual std::string getStreamName() const = 0;
36  std::string toString() const override = 0;
37  std::unique_ptr<IOrigin> clone() const override = 0;
38 
39  virtual bool operator<(const IOrigin &x) const override final;
40  bool operator<(const IDPositionOrigin &other) const;
41  bool operator==(const IDPositionOrigin &other) const;
42 
43  protected:
45  long start{};
46  long end{};
47  int index{};
48 };
49 
50 #endif // JODA_IDPOSITIONORIGIN_H
unsigned long FILEID
Definition: FileNameRepo.h:12
rapidjson::MemoryPoolAllocator< RJBaseAlloc > RJMemoryPoolAlloc
Definition: RJFwd.h:26
Definition: IDPositionOrigin.h:16
int index
Definition: IDPositionOrigin.h:47
int getIndex() const
Definition: IDPositionOrigin.cpp:22
long getStart() const
Definition: IDPositionOrigin.cpp:14
std::unique_ptr< RJDocument > reparse(RJMemoryPoolAlloc &alloc) const override
Definition: IDPositionOrigin.cpp:9
void setEnd(long end)
Definition: IDPositionOrigin.cpp:20
std::unique_ptr< IOrigin > clone() const override=0
bool isReparsable() const override
Definition: IDPositionOrigin.cpp:7
void setStart(long start)
Definition: IDPositionOrigin.cpp:16
long end
Definition: IDPositionOrigin.h:46
virtual ~IDPositionOrigin() override=default
void setIndex(int index)
Definition: IDPositionOrigin.cpp:24
virtual std::string getStreamName() const =0
IDPositionOrigin(FILEID id)
Definition: IDPositionOrigin.cpp:26
bool operator==(const IDPositionOrigin &other) const
Definition: IDPositionOrigin.cpp:47
long start
Definition: IDPositionOrigin.h:45
FILEID id
Definition: IDPositionOrigin.h:44
std::string toString() const override=0
long getEnd() const
Definition: IDPositionOrigin.cpp:18
virtual bool operator<(const IOrigin &x) const override final
Definition: IDPositionOrigin.cpp:31
Definition: IOrigin.h:21