Spicy
Public Member Functions | List of all members
hilti::util::Uniquer< ID > Class Template Reference

#include <uniquer.h>

Inheritance diagram for hilti::util::Uniquer< ID >:
hilti::util::Cache< ID, bool >

Public Member Functions

ID get (ID name, bool normalize=true)
 
void remove (const ID &id)
 

Detailed Description

template<typename ID>
class hilti::util::Uniquer< ID >

Specialized cache that makes IDs unique, based on previously created ones. The ID type must allow assignment from string to set its value.

Member Function Documentation

◆ get()

template<typename ID>
ID hilti::util::Uniquer< ID >::get ( ID  name,
bool  normalize = true 
)
inline

If we see id for the 1st time, returns it (potentially normalized). Otherwise returns a modified version that's guaranteed to not have been returned before.

Parameters
normalizeIf true, always modifies the returned ID to be a valid C ID.

◆ remove()

template<typename ID>
void hilti::util::Uniquer< ID >::remove ( const ID id)
inline

Clears a previously returned name for reuse.


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