Doxygen XLinks
by
V: 2511R0
Website: doxygen
Loading...
Searching...
No Matches
dxl::Index Class Reference

Description:

This class holds an alib::StringTree of all tags found in a doxygen tag-file. In addition, a non-unique hash-map is created that allows to find entities in O(1).

Definition at line 40 of file index.hpp.

#include <index.hpp>

Inheritance diagram for dxl::Index:
alib::containers::StringTree< alib::MonoAllocator, Target *, alib::containers::StringTreeNamesAlloc<> > alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >

Inner Type Index:

struct  AnchorKey
 A pod-like struct providing the key for the hash table found in the field Index::anchorMap. More...
struct  Node
 The cursor type of the StringTree. More...
struct  Parser
 Internal struct that parses a tag-file. Used by the method loadTagFile. More...
struct  SearchResult
 An entry in the vector of search results generated by the method Search. More...

Public Field Index:

const alib::StringBaseURL
 The URL of the HTML-output created with this tag-file.
alib::system::PathString FileName
 The base name component of FilePath.
alib::system::PathString FilePath
 The path to the doxygenTagFile.
const bool IsMainTagFile
Target::KindStats KindStats
 Statistics on the number of entities found per kind in Target::Kinds.
alib::Ticks::Duration LoadTime
 A timestamp set when loaded.
alib::SharedLock SLock
int StatCtdLines
 Statistics on the number of lines in the tag-file.

Public Method Index:

 Index (const alib::system::PathString &tagFilePath, const alib::String &baseURL, bool isMainTagFile)
 ~Index ()
 Destructor.
void DbgCriticalSectionCheck (alib::lang::Switch sWitch)
void DumpTree (Node branch)
ConstCursorHandle GetHTMLFileEntity (const alib::File &htmlFile)
Node ImportNode (CursorHandle handle)
void Load ()
 Loads the tag-file and creates the index.
void ReplaceFromTreeSeparator (alib::AString &buffer, Target::Kinds kind, alib::integer startPos=0)
void ReplaceToTreeSeparator (alib::AString &buffer, Target::Kinds kind, alib::integer startPos=0)
bool ScopeHintMatch (Node entry, XLink &searchLink)
void Search (XLink &xLink)
Public Method Index: inherited from alib::containers::StringTree< alib::MonoAllocator, Target *, alib::containers::StringTreeNamesAlloc<> >
 StringTree (AllocatorType &allocator, CharacterType pathSeparator)
void Clear ()
void ConstructRootValue (TArgs &&... args)
lang::DbgCriticalSectionsDbgGetDCS () const
void DbgSetDCSName (const char *name) const
void DestructRootValue ()
AllocatorTypeGetAllocator () noexcept
ConstCursor ImportCursor (ConstCursorHandle handle) const
bool IsEmpty () const
auto & NodeTable ()
integer RecyclablesCount () const
void ReserveRecyclables (integer qty, lang::ValueReference reference)
void Reset ()
Cursor Root ()
constexpr CharacterType Separator () const noexcept
integer Size () const

Protected Type Index:

using TreeType = StringTree
 The type of the string tree that holds the tag-file.
Protected Type Index: inherited from alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >
typedef typename TNodeHandler::CharacterType CharacterType
typedef TCursorBase< true > ConstCursorBase
typedef TCursorBase< false > CursorBase
typedef typename TNodeHandler::NameStringType NameStorageType
typedef const strings::TString< CharacterTypeNameType
typedef lang::BidiListHook< NodeBase > NodeList
typedef typename decltype(nodeTable)::SharedRecyclerType SharedRecyclerType
typedef typename strings::TSubstring< CharacterTypeSubstringType

Protected Field Index:

alib::containers::HashMap< alib::MonoAllocator, AnchorKey, CursorHandle, AnchorKey::Hash, std::equal_to< AnchorKey >, alib::lang::Caching::Enabled > anchorMap
 Maps HTML-files found to their corresponding tree nodes.
alib::containers::HashMap< alib::MonoAllocator, alib::String, CursorHandle > entityMap
alib::containers::HashMap< alib::MonoAllocator, const alib::String &, CursorHandle, std::hash< alib::String >, std::equal_to< const alib::String >, alib::lang::Caching::Disabled, alib::Recycling::None > fileMap
 Maps HTML-files found to their corresponding tree nodes.
alib::String fileNameDotComponents [10]
int fileNameDotComponentsSize
 The number of components in fileNameDotComponents.
alib::MonoAllocator ma
 The allocator used for the parent StringTree and for the hashtable in the field map.
Protected Field Index: inherited from alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >
int dbgRootDataSet
HashTable< TAllocator, typename NodeKey::ValueDescriptor, typename NodeKey::Hash, typename NodeKey::EqualTo, lang::Caching::Enabled, TRecycling > nodeTable
RootNodeSpacer root
CharacterType separator

Protected Method Index:

void dedupGroupEntries (alib::StdVectorMA< SearchResult > &targets)
void evaluateEntity (XLink &xLink, Node node, bool isIndirectByInheritance, bool isIndirectByTypeDef)
void loadTagFile ()
 Loads the tag-file. This is called by Load.
void searchFile (XLink &xLink)
Protected Method Index: inherited from alib::containers::StringTree< alib::MonoAllocator, Target *, alib::containers::StringTreeNamesAlloc<> >
Cursor createCursor (baseNode &node)
Protected Method Index: inherited from alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >
 StringTreeBase (TAllocator &allocator, CharacterType pathSeparator)
bool checkChildName (const NameType &name) const
TAllocator & GetAllocator () noexcept

Additional Inherited Members

Public Type Index: inherited from alib::containers::StringTree< alib::MonoAllocator, Target *, alib::containers::StringTreeNamesAlloc<> >
typedef TAllocator AllocatorType
typedef typename TNodeHandler::CharacterType CharacterType
typedef TCursor< true > ConstCursor
typedef TCursor< false > Cursor
typedef TNodeHandler HandlerType
typedef strings::TString< CharacterTypeNameType
typedef typename basetree::SharedRecyclerType SharedRecyclerType
typedef typename strings::TSubstring< CharacterTypeSubstringType

◆ DoxygenXLinks

friend class DoxygenXLinks
friend

Definition at line 43 of file index.hpp.

Type Definition Details:

◆ TreeType

using dxl::Index::TreeType = StringTree
protected

The type of the string tree that holds the tag-file.

Definition at line 47 of file index.hpp.

Field Details:

◆ anchorMap

alib::containers::HashMap<alib::MonoAllocator, AnchorKey, CursorHandle, AnchorKey::Hash, std::equal_to<AnchorKey>, alib::lang::Caching::Enabled > dxl::Index::anchorMap
protected

Maps HTML-files found to their corresponding tree nodes.

Definition at line 101 of file index.hpp.

◆ BaseURL

const alib::String& dxl::Index::BaseURL

The URL of the HTML-output created with this tag-file.

Definition at line 233 of file index.hpp.

◆ entityMap

alib::containers::HashMap<alib::MonoAllocator, alib::String, CursorHandle > dxl::Index::entityMap
protected

The hashmap providing an index to tree nodes by their name. For some compound types, for example, those that represent overloaded methods in C++, the tree node name string contains additional information like parameter types or method qualifiers. Those are stripped before inserted into this map. Thus, this table contains multiple entries and has to be fed and queried using the according set of interface methods.

Definition at line 84 of file index.hpp.

◆ fileMap

alib::containers::HashMap<alib::MonoAllocator, const alib::String&, CursorHandle, std::hash<alib::String>, std::equal_to<const alib::String>, alib::lang::Caching::Disabled, alib::Recycling::None > dxl::Index::fileMap
protected

Maps HTML-files found to their corresponding tree nodes.

Definition at line 93 of file index.hpp.

◆ FileName

alib::system::PathString dxl::Index::FileName

The base name component of FilePath.

Definition at line 230 of file index.hpp.

◆ fileNameDotComponents

alib::String dxl::Index::fileNameDotComponents[10]
protected

A list of parts of the FileName separated by dots. This is used by the methods ScopeHintMatch and Search to find scope-hints and parent-scopes.
This list is created once with construction.

Definition at line 248 of file index.hpp.

◆ fileNameDotComponentsSize

int dxl::Index::fileNameDotComponentsSize
protected

The number of components in fileNameDotComponents.

Definition at line 251 of file index.hpp.

◆ FilePath

alib::system::PathString dxl::Index::FilePath

The path to the doxygenTagFile.

Definition at line 227 of file index.hpp.

◆ IsMainTagFile

const bool dxl::Index::IsMainTagFile

Indicates whether this index is for the main tag file or an imported tag-file of a different project. Set with construction.

Definition at line 242 of file index.hpp.

◆ KindStats

Target::KindStats dxl::Index::KindStats

Statistics on the number of entities found per kind in Target::Kinds.

Definition at line 378 of file index.hpp.

◆ LoadTime

alib::Ticks::Duration dxl::Index::LoadTime

A timestamp set when loaded.

Definition at line 458 of file index.hpp.

◆ ma

alib::MonoAllocator dxl::Index::ma
protected

The allocator used for the parent StringTree and for the hashtable in the field map.

Definition at line 50 of file index.hpp.

◆ SLock

alib::SharedLock dxl::Index::SLock

A shared lock to this index. While most of the time (during link resolve) read-only access is needed, for a few operations a write-lock must be set. This is, for example, done in method tryResolveHTMLTargetFile, which modifies the index.

Definition at line 238 of file index.hpp.

◆ StatCtdLines

int dxl::Index::StatCtdLines

Statistics on the number of lines in the tag-file.

Definition at line 381 of file index.hpp.

Constructor(s) / Destructor Details:

◆ Index()

dxl::Index::Index ( const alib::system::PathString & tagFilePath,
const alib::String & baseURL,
bool isMainTagFile )

Constructor.

Parameters
tagFilePathThe path to the tag-file.
baseURLThe URL that the HTML files that this tag-files represent are found.
isMainTagFileSets field IsMainTagFile.

Definition at line 23 of file index.cpp.

◆ ~Index()

dxl::Index::~Index ( )

Destructor.

Definition at line 62 of file index.cpp.

Method Details:

◆ DbgCriticalSectionCheck()

void dxl::Index::DbgCriticalSectionCheck ( alib::lang::Switch sWitch)
inline

After all source code and html files have been scanned, DoxygenXLinks continues single-threadded. By calling this method from Run, we can omit locks in the rest of the code without getting warnings. However, when option –doxyfy is given, we later enable them again.

Parameters
sWitchDetermines to enable or disable the checks.

Definition at line 475 of file index.hpp.

◆ dedupGroupEntries()

void dxl::Index::dedupGroupEntries ( alib::StdVectorMA< SearchResult > & targets)
protected

Sub-function called at the end of the search-methods to remove group entries.

Parameters
targetsThe vector to remove group entries from.

Definition at line 693 of file index.cpp.

◆ DumpTree()

void dxl::Index::DumpTree ( Index::Node branch)

Dumps the contents of the tag-file branch to the Lox.

Parameters
branchThe branch to dump.

Definition at line 880 of file tagfile.cpp.

◆ evaluateEntity()

void dxl::Index::evaluateEntity ( XLink & xLink,
Node node,
bool isIndirectByInheritance,
bool isIndirectByTypeDef )
protected

Sub-function by Search which checks various things, like function arguments, template parameters, etc, and applies internal disambiguation rules.

Parameters
xLinkThe link that is processed.
nodeThe node to evaluate.
isIndirectByInheritanceSet if node is inherited member
isIndirectByTypeDefSet if node is indirectly found through a type definiton.

Definition at line 345 of file index.cpp.

◆ GetHTMLFileEntity()

Index::ConstCursorHandle dxl::Index::GetHTMLFileEntity ( const alib::File & htmlFile)

Returns the StringTree-node of the entity that is described in the given HTML file.

Parameters
htmlFileThe HTML file node.
Returns
A cursor pointing to the local entity.

Definition at line 209 of file index.cpp.

◆ ImportNode()

Node dxl::Index::ImportNode ( CursorHandle handle)
inline

Imports a node (cursor) previously exported with Export.

Parameters
handleThe handle value.
Returns
The imported node instance.

Definition at line 490 of file index.hpp.

◆ Load()

void dxl::Index::Load ( )

Loads the tag-file and creates the index.

Definition at line 76 of file index.cpp.

◆ loadTagFile()

void dxl::Index::loadTagFile ( )
protected

Loads the tag-file. This is called by Load.

Definition at line 372 of file tagfile.cpp.

◆ ReplaceFromTreeSeparator()

void dxl::Index::ReplaceFromTreeSeparator ( alib::AString & buffer,
Target::Kinds kind,
alib::integer startPos = 0 )

Replaces the tree separator with the character(s) appropriate for the given kind.

Parameters
bufferThe string buffer to modify.
kindThe kind of target for which the separator should be replaced.
startPosThe starting position within the buffer where the replacement should begin. Defaults to 0.

Definition at line 226 of file index.cpp.

◆ ReplaceToTreeSeparator()

void dxl::Index::ReplaceToTreeSeparator ( alib::AString & buffer,
Target::Kinds kind,
alib::integer startPos = 0 )

Replaces character(s) separating the scope of the given kind with the tree separator.

Parameters
bufferThe string buffer to modify.
kindThe kind of target for which the separator should be replaced.
startPosThe starting position within the buffer where the replacement should begin. Defaults to 0.

Definition at line 219 of file index.cpp.

◆ ScopeHintMatch()

bool dxl::Index::ScopeHintMatch ( Index::Node entry,
XLink & searchLink )

Tests if the given node in the Index's StringTree sits in a path that matches the path hints of the given searchLink.

Parameters
entryThe node in the "dxl #Index" to test.
searchLinkThe search definition to test against.
Returns
true if the path ints given with this search specification are matching this the path to the entry

Definition at line 235 of file index.cpp.

◆ Search()

void dxl::Index::Search ( XLink & xLink)

Searches entries in this doxygen tag-file index. The given results vector might be filled already by other instances of this type in the case that multiple tag-files are provided with the doxygen INI-file. Also, a call to this function might insert more than one result.

Parameters
xLinkThe link found in the HTML-files.

Definition at line 581 of file index.cpp.

◆ searchFile()

void dxl::Index::searchFile ( XLink & xLink)
protected

Sub-function called by method Search in case flag KindSpec equals Dir, hence a file is searched by "!d"-specification.

Parameters
xLinkThe link found in the HTML-files.

Definition at line 286 of file index.cpp.


The documentation for this class was generated from the following files: