slang-netlist  0.9.0
Loading...
Searching...
No Matches
slang::netlist::FileTable Class Reference

#include <TextLocation.hpp>

Public Member Functions

auto addFile (std::string_view name) -> uint32_t
void reserve (size_t count)
 Reserve capacity for the given number of entries.
auto getFilename (uint32_t index) const -> std::string_view
 Return the filename for the given index.
auto size () const -> size_t
 Return the number of unique filenames.

Static Public Attributes

static constexpr uint32_t NoFile = UINT32_MAX

Detailed Description

A centralised table of unique filenames, indexed by integer. This avoids duplicating filename strings across many TextLocation instances. Lookups are lock-free and only new insertions take a mutex.

Member Function Documentation

◆ addFile()

auto slang::netlist::FileTable::addFile ( std::string_view name) -> uint32_t
inline

Add a filename and return its index, or return the existing index if it is already present. Thread safe.

◆ getFilename()

auto slang::netlist::FileTable::getFilename ( uint32_t index) const -> std::string_view
inline

Return the filename for the given index.

◆ reserve()

void slang::netlist::FileTable::reserve ( size_t count)
inline

Reserve capacity for the given number of entries.

◆ size()

auto slang::netlist::FileTable::size ( ) const -> size_t
inline

Return the number of unique filenames.

Member Data Documentation

◆ NoFile

uint32_t slang::netlist::FileTable::NoFile = UINT32_MAX
staticconstexpr

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