Pyrogenesis
13997
|
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 |
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 | |
typedef boost::unordered_map < SItems, shared_ptr< SItems > > | InternedItems_t |
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.
Definition at line 39 of file ShaderDefines.h.
|
private |
Definition at line 112 of file ShaderDefines.h.
CShaderParams< value_t >::CShaderParams | ( | ) |
Create an empty map of defines.
Definition at line 106 of file ShaderDefines.cpp.
|
private |
Definition at line 112 of file ShaderDefines.cpp.
|
staticprivate |
Definition at line 117 of file ShaderDefines.cpp.
size_t CShaderParams< value_t >::GetHash | ( | ) | const |
Return a hash of the current mapping.
Definition at line 176 of file ShaderDefines.cpp.
|
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.
Definition at line 87 of file ShaderDefines.cpp.
std::map< CStrIntern, value_t > CShaderParams< value_t >::GetMap | ( | ) | const |
Return a copy of the current name/value mapping.
Definition at line 167 of file ShaderDefines.cpp.
|
inline |
Fast inequality comparison.
Definition at line 90 of file ShaderDefines.h.
|
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).
Definition at line 74 of file ShaderDefines.h.
|
inline |
Fast equality comparison.
Definition at line 82 of file ShaderDefines.h.
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.
Definition at line 125 of file ShaderDefines.cpp.
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.
Definition at line 151 of file ShaderDefines.cpp.
|
protected |
Definition at line 109 of file ShaderDefines.h.
|
staticprivate |
Definition at line 124 of file ShaderDefines.h.
|
staticprivate |
Definition at line 113 of file ShaderDefines.h.