MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
mostly_harmless::ParameterID Struct Reference

Convenience class for generating a parameter id. More...

#include <mostlyharmless_Parameters.h>

Public Member Functions

 ParameterID (std::string_view internalName)
 
std::string toString () const noexcept
 

Public Attributes

const std::uint32_t pid
 

Detailed Description

Convenience class for generating a parameter id.

Generates a hash for the given string, to be used as a unique parameter id when registering the parameters in the framework. Note that this hinges on your internalNames for each parameter being unique - if they're not, all hell will break loose

Constructor & Destructor Documentation

◆ ParameterID()

mostly_harmless::ParameterID::ParameterID ( std::string_view internalName)
inlineexplicit

Creates a ParameterID from a given string view. Generates the hash for the string at construction, and stores as a member.

Parameters
internalNameThe name to hash. Again, when using this to create params, make sure this is unique!

Member Function Documentation

◆ toString()

std::string mostly_harmless::ParameterID::toString ( ) const
inlinenodiscardnoexcept

Converts the PID to a string.

Returns
std::to_string on the pid member.

Member Data Documentation

◆ pid

const std::uint32_t mostly_harmless::ParameterID::pid

The hashed representation of the argument passed to the constructor.


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