OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
detail::EnumSerializationTable Class Reference

#include <EnumSerializer.h>

Public Member Functions

template<class T >
 EnumSerializationTable (CaseSensitivity caseSensitivity, std::initializer_list< std::pair< T, const char * > > pairs)
 
bool trySerialize (uint64_t src, std::string *dst) const
 
bool tryDeserialize (std::string_view src, uint64_t *dst) const
 
bool isUsableWithFlags () const
 
bool trySerializeFlags (uint64_t src, std::string *dst) const
 
bool tryDeserializeFlags (std::string_view src, uint64_t *dst) const
 

Private Member Functions

void insert (uint64_t value, std::string_view name)
 
void polish ()
 

Private Attributes

CaseSensitivity _caseSensitivity
 
std::unordered_map< uint64_t, std::string > _stringByEnum
 
std::unordered_map< std::string, uint64_t, TransparentStringHash, TransparentStringEquals_enumByString
 
std::vector< std::pair< uint64_t, std::string > > _sortedEnumStrings
 

Constructor & Destructor Documentation

◆ EnumSerializationTable()

template<class T >
detail::EnumSerializationTable::EnumSerializationTable ( CaseSensitivity  caseSensitivity,
std::initializer_list< std::pair< T, const char * > >  pairs 
)
inline

Member Function Documentation

◆ insert()

void detail::EnumSerializationTable::insert ( uint64_t  value,
std::string_view  name 
)
private

◆ isUsableWithFlags()

bool detail::EnumSerializationTable::isUsableWithFlags ( ) const

◆ polish()

void detail::EnumSerializationTable::polish ( )
private

◆ tryDeserialize()

bool detail::EnumSerializationTable::tryDeserialize ( std::string_view  src,
uint64_t *  dst 
) const

◆ tryDeserializeFlags()

bool detail::EnumSerializationTable::tryDeserializeFlags ( std::string_view  src,
uint64_t *  dst 
) const

◆ trySerialize()

bool detail::EnumSerializationTable::trySerialize ( uint64_t  src,
std::string *  dst 
) const

◆ trySerializeFlags()

bool detail::EnumSerializationTable::trySerializeFlags ( uint64_t  src,
std::string *  dst 
) const

Member Data Documentation

◆ _caseSensitivity

CaseSensitivity detail::EnumSerializationTable::_caseSensitivity
private

◆ _enumByString

std::unordered_map<std::string, uint64_t, TransparentStringHash, TransparentStringEquals> detail::EnumSerializationTable::_enumByString
private

◆ _sortedEnumStrings

std::vector<std::pair<uint64_t, std::string> > detail::EnumSerializationTable::_sortedEnumStrings
private

◆ _stringByEnum

std::unordered_map<uint64_t, std::string> detail::EnumSerializationTable::_stringByEnum
private

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