OOFEM 3.0
Loading...
Searching...
No Matches
oofem::ParamKey Class Reference

#include <paramkey.h>

Public Types

using IndexType = size_t

Public Member Functions

 ParamKey (std::string name)
IndexType getIndex () const
const std::string & getName () const
const char * getNameCStr () const

Static Public Member Functions

static std::string getDebugName (IndexType index)

Static Private Member Functions

static IndexType generateUniqueIndex ()
static void registerDebugName (IndexType index, const std::string &name)

Private Attributes

std::string name_
IndexType index_

Static Private Attributes

static std::unordered_map< IndexType, std::string > debugNames_
static std::shared_mutex debugMutex_

Friends

std::ostream & operator<< (std::ostream &os, const ParamKey &key)

Detailed Description

ParamKey class is used to create unique keys for parameters in a thread-safe manner. It generates a unique index for each key and allows for debug name registration.

Definition at line 51 of file paramkey.h.

Member Typedef Documentation

◆ IndexType

Definition at line 53 of file paramkey.h.

Constructor & Destructor Documentation

◆ ParamKey()

oofem::ParamKey::ParamKey ( std::string name)
inlineexplicit

Definition at line 55 of file paramkey.h.

References generateUniqueIndex(), index_, name_, and registerDebugName().

Referenced by operator<<.

Member Function Documentation

◆ generateUniqueIndex()

IndexType oofem::ParamKey::generateUniqueIndex ( )
inlinestaticprivate

Definition at line 78 of file paramkey.h.

Referenced by ParamKey().

◆ getDebugName()

std::string oofem::ParamKey::getDebugName ( IndexType index)
inlinestatic

Definition at line 64 of file paramkey.h.

References debugMutex_, and debugNames_.

◆ getIndex()

IndexType oofem::ParamKey::getIndex ( ) const
inline

Definition at line 60 of file paramkey.h.

References index_.

◆ getName()

const std::string & oofem::ParamKey::getName ( ) const
inline

Definition at line 61 of file paramkey.h.

References name_.

◆ getNameCStr()

const char * oofem::ParamKey::getNameCStr ( ) const
inline

Definition at line 62 of file paramkey.h.

References name_.

◆ registerDebugName()

void oofem::ParamKey::registerDebugName ( IndexType index,
const std::string & name )
inlinestaticprivate

Definition at line 83 of file paramkey.h.

References debugMutex_, and debugNames_.

Referenced by ParamKey().

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const ParamKey & key )
friend

Definition at line 70 of file paramkey.h.

References index_, name_, and ParamKey().

Member Data Documentation

◆ debugMutex_

std::shared_mutex oofem::ParamKey::debugMutex_
inlinestaticprivate

Definition at line 89 of file paramkey.h.

Referenced by getDebugName(), and registerDebugName().

◆ debugNames_

std::unordered_map<IndexType, std::string> oofem::ParamKey::debugNames_
inlinestaticprivate

Definition at line 88 of file paramkey.h.

Referenced by getDebugName(), and registerDebugName().

◆ index_

IndexType oofem::ParamKey::index_
private

Definition at line 76 of file paramkey.h.

Referenced by getIndex(), operator<<, and ParamKey().

◆ name_

std::string oofem::ParamKey::name_
private

Definition at line 75 of file paramkey.h.

Referenced by getName(), getNameCStr(), operator<<, and ParamKey().


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011