Pyrogenesis trunk
|
Represents a mapping of name strings to value, for use with CShaderDefines (values are strings) and CShaderUniforms (values are vec4s). More...
#include <ShaderDefines.h>
Classes | |
struct | SItems |
struct | SItemsHash |
Public Member Functions | |
CShaderParams () | |
Create an empty map of defines. More... | |
void | Set (CStrIntern name, const value_t &value) |
Add a name and associated value to the map of parameters. More... | |
void | SetMany (const CShaderParams ¶ms) |
Add all the names and values from another set of parameters. More... | |
std::map< CStrIntern, value_t > | GetMap () const |
Return a copy of the current name/value mapping. More... | |
size_t | GetHash () const |
Return a hash of the current mapping. More... | |
bool | operator< (const CShaderParams &b) const |
Compare with some arbitrary total order. More... | |
bool | operator== (const CShaderParams &b) const |
Fast equality comparison. More... | |
bool | operator!= (const CShaderParams &b) const |
Fast inequality comparison. More... | |
Protected Attributes | |
SItems * | m_Items |
Private Types | |
using | InternedItems_t = std::unordered_map< SItems, std::shared_ptr< SItems >, SItemsHash > |
Private Member Functions | |
CShaderParams (SItems *items) | |
Static Private Member Functions | |
static SItems * | GetInterned (const SItems &items) |
Returns a pointer to an SItems equal to items . More... | |
static CShaderParams | CreateEmpty () |
Static Private Attributes | |
static InternedItems_t | s_InternedItems |
static CShaderParams | s_Empty |
Represents a mapping of name strings to value, for use with CShaderDefines (values are strings) and CShaderUniforms (values are vec4s).
Stored as interned vectors of name-value pairs, to support high performance comparison operators.
Not thread-safe - must only be used from the main thread.
|
private |
CShaderParams< value_t >::CShaderParams |
Create an empty map of defines.
|
private |
|
staticprivate |
size_t CShaderParams< value_t >::GetHash |
Return a hash of the current mapping.
|
staticprivate |
Returns a pointer to an SItems equal to items
.
The pointer will be valid forever, and the same pointer will be returned for any subsequent requests for an equal items list.
std::map< CStrIntern, value_t > CShaderParams< value_t >::GetMap |
Return a copy of the current name/value mapping.
|
inline |
Fast inequality comparison.
|
inline |
Compare with some arbitrary total order.
The order may be different each time the application is run (it is based on interned memory addresses).
|
inline |
Fast equality comparison.
void CShaderParams< value_t >::Set | ( | CStrIntern | name, |
const value_t & | value | ||
) |
Add a name and associated value to the map of parameters.
If the name is already defined, its value will be replaced.
void CShaderParams< value_t >::SetMany | ( | const CShaderParams< value_t > & | params | ) |
Add all the names and values from another set of parameters.
If any name is already defined in this object, its value will be replaced.
|
protected |
|
staticprivate |
|
staticprivate |