Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
Table Class Reference

#include "steam/engine/buffer-metadata.hpp"

Description

(Hash)Table to store and manage buffer metadata.

Buffer metadata entries are comprised of a Key part and an extended Entry, holding the actual management and housekeeping metadata. The Keys are organised hierarchically and denote the "kind" of buffer. The hash values for lookup are based on the key part, chained with the actual memory location of the concrete buffer corresponding to the metadata entry to be retrieved.

Definition at line 438 of file buffer-metadata.hpp.

Public Member Functions

 ~Table ()
 
Entryfetch (HashVal hashID)
 fetch metadata record, if any
 
const Entryfetch (HashVal hashID) const
 
Entrystore (Entry const &newEntry)
 store a copy of the given new metadata entry.
 
void remove (HashVal hashID)
 

Private Types

using MetadataStore = std::unordered_map< HashVal, Entry >
 

Private Member Functions

void verify_all_buffers_freed ()
 

Static Private Member Functions

static void verify_is_free (std::pair< HashVal, Entry > const &e)
 

Private Attributes

MetadataStore entries_
 

Constructor & Destructor Documentation

◆ ~Table()

~Table ( )
inline

Definition at line 445 of file buffer-metadata.hpp.

References Table::verify_all_buffers_freed().

+ Here is the call graph for this function:

Member Typedef Documentation

◆ MetadataStore

using MetadataStore = std::unordered_map<HashVal,Entry>
private

Definition at line 440 of file buffer-metadata.hpp.

Member Function Documentation

◆ fetch() [1/2]

Entry * fetch ( HashVal  hashID)
inline

fetch metadata record, if any

Parameters
hashIDfor the Key part of the metadata entry
Returns
pointer to the entry in the table or NULL

Definition at line 452 of file buffer-metadata.hpp.

References Table::entries_, and NULL.

Referenced by BufferMetadata::get(), BufferMetadata::isKnown(), BufferMetadata::isLocked(), BufferMetadata::key(), BufferMetadata::lock(), BufferMetadata::release(), and Table::store().

+ Here is the caller graph for this function:

◆ fetch() [2/2]

const Entry * fetch ( HashVal  hashID) const
inline

Definition at line 462 of file buffer-metadata.hpp.

References Table::entries_, and NULL.

◆ store()

Entry & store ( Entry const &  newEntry)
inline

store a copy of the given new metadata entry.

The hash key for lookup is retrieved from the given Entry, by conversion to HashVal. Consequently, this will be the hashID of the parent Key (type), when the entry holds a NULL buffer (i.e a "pseudo entry"). Otherwise, it will be this parent Key hash, extended by hashing the actual buffer address.

Returns
reference to relevant entry for this Key. This might be a copy of the new entry, or an already existing entry with the same Key

Definition at line 480 of file buffer-metadata.hpp.

References Table::entries_, and Table::fetch().

Referenced by BufferMetadata::maybeStore(), and BufferMetadata::store_as_locked().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

void remove ( HashVal  hashID)
inline

Definition at line 491 of file buffer-metadata.hpp.

References Table::entries_.

Referenced by BufferMetadata::release().

+ Here is the caller graph for this function:

◆ verify_all_buffers_freed()

void verify_all_buffers_freed ( )
inlineprivate

Definition at line 499 of file buffer-metadata.hpp.

References Table::entries_, and Table::verify_is_free().

Referenced by Table::~Table().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_is_free()

static void verify_is_free ( std::pair< HashVal, Entry > const &  e)
inlinestaticprivate

Definition at line 507 of file buffer-metadata.hpp.

Referenced by Table::verify_all_buffers_freed().

+ Here is the caller graph for this function:

Member Data Documentation

◆ entries_

+ Collaboration diagram for Table:

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