15#ifndef WSFPPROXYINDEX_HPP
16#define WSFPPROXYINDEX_HPP
18#include "wsf_parser_export.h"
22#include <unordered_map>
24#include "UtMemory.hpp"
25#include "UtTextDocument.hpp"
56 return iter->second.get();
66 std::tie(it, std::ignore) =
mChildren.insert(std::make_pair(e, ut::make_unique<WsfPProxyIndexNode>(
this, e)));
113 void BuildReverseIndex();
123 const std::vector<ReverseIndexEntry>&
GetReverseIndex()
const {
return mReverseIndex; }
125 ReverseIndexEntry* FindByParseNodeIndex(
size_t& aParseNodeIndex,
size_t& aSubEntry);
134 std::vector<ReverseIndexEntry> mReverseIndex;
135 struct NodeIndexMapping
143 NodeIndexMapping(
size_t aLexicalIndex);
145 bool operator<(
const NodeIndexMapping& aRhs)
const {
return mLexicalIndex < aRhs.mLexicalIndex; }
146 bool operator<(
size_t aLexicalIndex)
const {
return mLexicalIndex < aLexicalIndex; }
148 size_t mLexicalIndex;
149 size_t mReverseIndex;
153 std::vector<NodeIndexMapping> mNodeIndexMappingList;
156 WsfPProxyIndexNode mRoot;
159 WsfPProxyPath* mEmptyPath;
160 std::map<size_t, WsfPProxyPath*> mNodeCurrentPaths;
@ cMDB_PROXY_INDEX
Definition WsfParseDebugMarkers.hpp:22
Definition WsfPProxyIndex.hpp:38
WsfPProxyIndexNode * FindChild(const WsfPProxyKey &e)
Definition WsfPProxyIndex.hpp:51
WsfPProxyIndexNode & GetChild(const WsfPProxyKey &e)
Definition WsfPProxyIndex.hpp:61
std::vector< WsfPProxyIndexEntry > mEntries
Definition WsfPProxyIndex.hpp:88
WsfPProxyIndexNode(WsfPProxyIndexNode *aParentPtr, const WsfPProxyKey &e)
Definition WsfPProxyIndex.hpp:40
NodeMap mChildren
Definition WsfPProxyIndex.hpp:90
WsfPProxyIndexNode(const WsfPProxyIndexNode &)=delete
void GetPath(WsfPProxyPath &aPath)
Definition WsfPProxyIndex.hpp:78
~WsfPProxyIndexNode()
Definition WsfPProxyIndex.hpp:49
WsfPProxyKey mAddr
Definition WsfPProxyIndex.hpp:86
void AddLocation(WsfParseNode *aNodePtr, int aEntryType)
Definition WsfPProxyIndex.hpp:71
WsfPProxyIndexNode * mParentPtr
Definition WsfPProxyIndex.hpp:87
std::unordered_map< WsfPProxyKey, std::unique_ptr< WsfPProxyIndexNode >, WsfPProxyPathEntryHash > NodeMap
Definition WsfPProxyIndex.hpp:89
WsfPProxyIndexNode & operator=(const WsfPProxyIndexNode &)=delete
Definition WsfPProxyIndex.hpp:96
WsfPProxyIndex()
Definition WsfPProxyIndex.cpp:155
const std::vector< ReverseIndexEntry > & GetReverseIndex() const
Definition WsfPProxyIndex.hpp:123
WsfPProxyIndexNode & Root()
Definition WsfPProxyIndex.hpp:109
EntryType
Definition WsfPProxyIndex.hpp:99
@ cASSIGNED
Definition WsfPProxyIndex.hpp:102
@ cEDITED
Definition WsfPProxyIndex.hpp:101
@ cREMOVED
Definition WsfPProxyIndex.hpp:103
@ cADDED
Definition WsfPProxyIndex.hpp:100
bool mRecordCurrentPath
Definition WsfPProxyIndex.hpp:128
Definition WsfPProxyKey.hpp:24
Represents a path or unique key to a value in the proxy.
Definition WsfPProxyPath.hpp:64
Definition WsfParseNode.hpp:61
Definition WsfPProxyIndex.hpp:31
int mEntryType
Definition WsfPProxyIndex.hpp:32
WsfParseNode * mNodePtr
Definition WsfPProxyIndex.hpp:34
Definition WsfPProxyIndex.hpp:116
size_t mEntryIndex
Definition WsfPProxyIndex.hpp:121
WsfPProxyIndexNode * mNodePtr
Definition WsfPProxyIndex.hpp:119
size_t mLexicalIndex
Definition WsfPProxyIndex.hpp:120
bool operator<(const ReverseIndexEntry &aRhs) const
Definition WsfPProxyIndex.hpp:117
UtTextDocumentLocation mLocation
Definition WsfPProxyIndex.hpp:118
Definition WsfPProxyPath.hpp:38