Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
Symap Class Reference

A string interner (Symbol Map). More...

#include <src/utils/symap.h>

Public Member Functions

 Symap (const Symap &other)
 
Symapoperator= (const Symap &other)
 
 Symap (Symap &&other)
 
Symapoperator= (Symap &&other)
 
uint32_t try_map (const char *sym)
 Map a string to a symbol ID if it is already mapped, otherwise return 0.
 
uint32_t map (const char *sym)
 Map a string to a symbol ID.
 
const char * unmap (uint32_t id)
 Unmap a symbol ID back to a symbol, or NULL if no such ID exists.
 

Friends

void swap (Symap &first, Symap &second)
 

Detailed Description

A string interner (Symbol Map).

Definition at line 45 of file symap.h.

Constructor & Destructor Documentation

◆ Symap() [1/2]

Symap::Symap ( const Symap & other)
inline

Definition at line 49 of file symap.h.

◆ Symap() [2/2]

Symap::Symap ( Symap && other)
inline

Definition at line 56 of file symap.h.

Member Function Documentation

◆ map()

uint32_t Symap::map ( const char * sym)

Map a string to a symbol ID.

Note that 0 is never a valid symbol ID.

◆ operator=() [1/2]

Symap & Symap::operator= ( const Symap & other)
inline

Definition at line 50 of file symap.h.

◆ operator=() [2/2]

Symap & Symap::operator= ( Symap && other)
inline

Definition at line 57 of file symap.h.

◆ unmap()

const char * Symap::unmap ( uint32_t id)

Unmap a symbol ID back to a symbol, or NULL if no such ID exists.

Note that 0 is never a valid symbol ID.

Friends And Related Symbol Documentation

◆ swap

void swap ( Symap & first,
Symap & second )
friend

Definition at line 65 of file symap.h.


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