Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
SymbolId< Tag > Class Template Reference

Returns an uppercase copy of the input string. More...

#include <dynamic_registry.h>

Public Member Functions

 SymbolId ()=default
 Default constructor, creates an empty identifier.
 
 SymbolId (std::string n)
 Constructs a SymbolId from a string.
 
const std::string & str () const
 Returns the underlying string.
 
 SymbolId ()=default
 Constructs an empty identifier.
 
 SymbolId (std::string name)
 Constructs an identifier from a string.
 
const std::string & str () const
 Returns the underlying string.
 
 operator const std::string & () const
 Explicit conversion to const std::string&.
 
bool empty () const
 Returns true if the identifier is empty.
 

Friends

bool operator== (const SymbolId &a, const SymbolId &b)
 Case-insensitive equality comparison for SymbolId<Tag>.
 
bool operator!= (const SymbolId &a, const SymbolId &b)
 
bool operator< (const SymbolId &a, const SymbolId &b)
 Case-insensitive strict ordering for SymbolId<Tag>.
 

Detailed Description

template<class Tag>
class SymbolId< Tag >

Returns an uppercase copy of the input string.

Strongly-typed string identifier.

SymbolId<Tag> wraps a std::string in a lightweight type that is distinguished by its tag parameter. This avoids mixing identifiers that share the same underlying representation but belong to different domains (e.g. observable IDs vs. parameter IDs).

The class itself only stores the original string and exposes it via str(). Equality, ordering and hashing are defined externally and are case-insensitive via normalize_key().

Template Parameters
TagEmpty tag type used to distinguish different identifier kinds.

Definition at line 47 of file dynamic_registry.h.

Constructor & Destructor Documentation

◆ SymbolId() [1/4]

template<class Tag >
SymbolId< Tag >::SymbolId ( )
default

Default constructor, creates an empty identifier.

◆ SymbolId() [2/4]

template<class Tag >
SymbolId< Tag >::SymbolId ( std::string  n)
inlineexplicit

Constructs a SymbolId from a string.

The string is stored as-is; normalization (lowercasing, etc.) is performed only in comparison and hashing functions.

Parameters
nIdentifier name.

Definition at line 63 of file dynamic_registry.h.

◆ SymbolId() [3/4]

template<class Tag >
SymbolId< Tag >::SymbolId ( )
default

Constructs an empty identifier.

◆ SymbolId() [4/4]

template<class Tag >
SymbolId< Tag >::SymbolId ( std::string  name)
inlineexplicit

Constructs an identifier from a string.

Definition at line 38 of file symbol_id.hpp.

Member Function Documentation

◆ empty()

template<class Tag >
bool SymbolId< Tag >::empty ( ) const
inline

Returns true if the identifier is empty.

Definition at line 47 of file symbol_id.hpp.

◆ operator const std::string &()

template<class Tag >
SymbolId< Tag >::operator const std::string & ( ) const
inlineexplicit

Explicit conversion to const std::string&.

Definition at line 44 of file symbol_id.hpp.

◆ str() [1/2]

template<class Tag >
const std::string & SymbolId< Tag >::str ( ) const
inline

Returns the underlying string.

This is the original, non-normalized name.

Returns
Const reference to the stored string.

Definition at line 72 of file dynamic_registry.h.

◆ str() [2/2]

template<class Tag >
const std::string & SymbolId< Tag >::str ( ) const
inline

Returns the underlying string.

Definition at line 41 of file symbol_id.hpp.

Friends And Related Symbol Documentation

◆ operator!=

template<class Tag >
bool operator!= ( const SymbolId< Tag > &  a,
const SymbolId< Tag > &  b 
)
friend

Definition at line 50 of file symbol_id.hpp.

◆ operator<

template<class Tag >
bool operator< ( const SymbolId< Tag > &  a,
const SymbolId< Tag > &  b 
)
friend

Case-insensitive strict ordering for SymbolId<Tag>.

The ordering is defined by lexicographic comparison of the normalized names (see normalize_key()). This allows SymbolId<Tag> to be used as keys in ordered containers if needed.

Template Parameters
TagTag type of the SymbolId.
Parameters
aFirst identifier.
bSecond identifier.
Returns
true if the normalized name of a is lexicographically smaller than that of b.

Definition at line 51 of file symbol_id.hpp.

◆ operator==

template<class Tag >
bool operator== ( const SymbolId< Tag > &  a,
const SymbolId< Tag > &  b 
)
friend

Case-insensitive equality comparison for SymbolId<Tag>.

Two SymbolId<Tag> values are considered equal if their normalized names (as returned by normalize_key()) are equal, independently of original case.

Template Parameters
TagTag type of the SymbolId.
Parameters
aFirst identifier.
bSecond identifier.
Returns
true if both identifiers are equal under normalization.

Definition at line 49 of file symbol_id.hpp.


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