diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/containers/comptrie/node.h | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers/comptrie/node.h')
-rw-r--r-- | library/cpp/containers/comptrie/node.h | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/library/cpp/containers/comptrie/node.h b/library/cpp/containers/comptrie/node.h index 9a936998b5..d6f4317db0 100644 --- a/library/cpp/containers/comptrie/node.h +++ b/library/cpp/containers/comptrie/node.h @@ -3,78 +3,78 @@ #include <cstddef> namespace NCompactTrie { - class ILeafSkipper; + class ILeafSkipper; - enum TDirection { - D_LEFT, - D_FINAL, - D_NEXT, - D_RIGHT, - D_MAX - }; - - inline TDirection& operator++(TDirection& direction) { - direction = static_cast<TDirection>(direction + 1); - return direction; - } + enum TDirection { + D_LEFT, + D_FINAL, + D_NEXT, + D_RIGHT, + D_MAX + }; - inline TDirection& operator--(TDirection& direction) { - direction = static_cast<TDirection>(direction - 1); - return direction; - } + inline TDirection& operator++(TDirection& direction) { + direction = static_cast<TDirection>(direction + 1); + return direction; + } - class TNode { - public: - TNode(); - // Processes epsilon links and sets ForwardOffset to correct value. Assumes an epsilon link doesn't point to an epsilon link. - TNode(const char* data, size_t offset, const ILeafSkipper& skipFunction); + inline TDirection& operator--(TDirection& direction) { + direction = static_cast<TDirection>(direction - 1); + return direction; + } - size_t GetOffset() const { - return Offset; - } + class TNode { + public: + TNode(); + // Processes epsilon links and sets ForwardOffset to correct value. Assumes an epsilon link doesn't point to an epsilon link. + TNode(const char* data, size_t offset, const ILeafSkipper& skipFunction); - size_t GetLeafOffset() const { - return Offsets[D_FINAL]; - } - size_t GetLeafLength() const { - return LeafLength; - } - size_t GetCoreLength() const { - return CoreLength; - } + size_t GetOffset() const { + return Offset; + } - size_t GetOffsetByDirection(TDirection direction) const { - return Offsets[direction]; - } + size_t GetLeafOffset() const { + return Offsets[D_FINAL]; + } + size_t GetLeafLength() const { + return LeafLength; + } + size_t GetCoreLength() const { + return CoreLength; + } - size_t GetForwardOffset() const { - return Offsets[D_NEXT]; - } - size_t GetLeftOffset() const { - return Offsets[D_LEFT]; - } - size_t GetRightOffset() const { - return Offsets[D_RIGHT]; - } - char GetLabel() const { - return Label; - } + size_t GetOffsetByDirection(TDirection direction) const { + return Offsets[direction]; + } - bool IsFinal() const { - return GetLeafOffset() != 0; - } + size_t GetForwardOffset() const { + return Offsets[D_NEXT]; + } + size_t GetLeftOffset() const { + return Offsets[D_LEFT]; + } + size_t GetRightOffset() const { + return Offsets[D_RIGHT]; + } + char GetLabel() const { + return Label; + } - bool HasEpsilonLinkForward() const { - return GetForwardOffset() > Offset + CoreLength; - } - - private: - size_t Offsets[D_MAX]; - size_t Offset; - size_t LeafLength; - size_t CoreLength; + bool IsFinal() const { + return GetLeafOffset() != 0; + } - char Label; - }; + bool HasEpsilonLinkForward() const { + return GetForwardOffset() > Offset + CoreLength; + } -} + private: + size_t Offsets[D_MAX]; + size_t Offset; + size_t LeafLength; + size_t CoreLength; + + char Label; + }; + +} |