Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES > Class Template Reference

SDL enum implementation with common features. Enum value and string mapping are done in a brute-force way. This SDL enum type supports enum entries with identical value or name, which is useful for giving the user more tolerance on specifying inputs (e.g., case inconsistency). See getTypedEntry() for more details. More...

#include <TSdlGeneralEnum.h>

Inheritance diagram for ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >:
ph::SdlEnum

Public Types

using EnumType = InEnumType
 
- Public Types inherited from ph::SdlEnum
using Entry = TEntry<int64>
 

Public Member Functions

 TSdlGeneralEnum (std::string name)
 
Entry getEntry (const std::size_t entryIndex) const override
 
std::size_t numEntries () const override
 
TSdlGeneralEnumaddEntry (const EnumType enumValue, const std::string_view valueName, std::string description="")
 
TEntry< EnumTypegetTypedEntry (const std::size_t entryIndex) const
 
TEntry< EnumTypegetTypedEntry (const std::string_view entryName) const
 Get an enum entry via an enum name. Note that the method cannot distinguish between identical enum names, i.e., if two entries have the same enum name, their entries cannot be uniquely identified and returned (however, the returned entry is consistent within the same SDL version).
 
TEntry< EnumTypegetTypedEntry (const EnumType enumValue) const
 Get an enum entry via an enum value. Note that the method cannot distinguish between identical enum values, i.e., if two entries have the same enum value, their entries cannot be uniquely identified and returned (however, the returned entry is consistent within the same SDL version).
 
TSdlGeneralEnumdescription (std::string descriptionStr)
 
- Public Member Functions inherited from ph::SdlEnum
 SdlEnum (std::string name)
 
const std::string & getName () const
 
const std::string & getDescription () const
 
std::string getEntryDescription (std::size_t entryIndex) const
 

Additional Inherited Members

- Protected Member Functions inherited from ph::SdlEnum
SdlEnumsetDescription (std::string description)
 
SdlEnumsetEntryDescription (std::size_t entryIndex, std::string description)
 

Detailed Description

template<typename InEnumType, std::size_t MAX_ENTRIES = 64>
class ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >

SDL enum implementation with common features. Enum value and string mapping are done in a brute-force way. This SDL enum type supports enum entries with identical value or name, which is useful for giving the user more tolerance on specifying inputs (e.g., case inconsistency). See getTypedEntry() for more details.

Member Typedef Documentation

◆ EnumType

template<typename InEnumType , std::size_t MAX_ENTRIES = 64>
using ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >::EnumType = InEnumType

Constructor & Destructor Documentation

◆ TSdlGeneralEnum()

template<typename InEnumType , std::size_t MAX_ENTRIES = 64>
ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >::TSdlGeneralEnum ( std::string name)
inlineexplicit

Member Function Documentation

◆ addEntry()

template<typename InEnumType , std::size_t MAX_ENTRIES = 64>
TSdlGeneralEnum & ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >::addEntry ( const EnumType enumValue,
const std::string_view valueName,
std::string description = "" )
inline

◆ description()

template<typename InEnumType , std::size_t MAX_ENTRIES = 64>
TSdlGeneralEnum & ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >::description ( std::string descriptionStr)
inline

◆ getEntry()

template<typename InEnumType , std::size_t MAX_ENTRIES = 64>
Entry ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >::getEntry ( const std::size_t entryIndex) const
inlineoverridevirtual

Implements ph::SdlEnum.

◆ getTypedEntry() [1/3]

template<typename InEnumType , std::size_t MAX_ENTRIES = 64>
TEntry< EnumType > ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >::getTypedEntry ( const EnumType enumValue) const
inline

Get an enum entry via an enum value. Note that the method cannot distinguish between identical enum values, i.e., if two entries have the same enum value, their entries cannot be uniquely identified and returned (however, the returned entry is consistent within the same SDL version).

◆ getTypedEntry() [2/3]

template<typename InEnumType , std::size_t MAX_ENTRIES = 64>
TEntry< EnumType > ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >::getTypedEntry ( const std::size_t entryIndex) const
inline

◆ getTypedEntry() [3/3]

template<typename InEnumType , std::size_t MAX_ENTRIES = 64>
TEntry< EnumType > ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >::getTypedEntry ( const std::string_view entryName) const
inline

Get an enum entry via an enum name. Note that the method cannot distinguish between identical enum names, i.e., if two entries have the same enum name, their entries cannot be uniquely identified and returned (however, the returned entry is consistent within the same SDL version).

◆ numEntries()

template<typename InEnumType , std::size_t MAX_ENTRIES = 64>
std::size_t ph::TSdlGeneralEnum< InEnumType, MAX_ENTRIES >::numEntries ( ) const
inlineoverridevirtual

Implements ph::SdlEnum.


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