My Project
|
a name, value pair. More...
#include <ParameterBlock.h>
Public Types | |
enum | PARAMETER_TYPE { PARAM_UNKNOWN, PARAM_INT, PARAM_FLOAT, PARAM_BOOLEAN, PARAM_VECTOR2, PARAM_VECTOR3, PARAM_VECTOR4, PARAM_MATRIX, PARAM_RAWBYTES, PARAM_TEXTURE_ENTITY, PARAM_LAST } |
current type of the parameter | |
typedef TextureEntity * | LPTextureEntity |
Public Member Functions | |
CParameter (const string &sName) | |
const string & | GetTypeAsString () |
get the current type as a string, "unknown", "int", "boolean", "float", "vector2", "vector3","vector4","matrix43", "texture", "rawbytes" | |
PARAMETER_TYPE | SetTypeByString (const char *sType) |
set parameter type by string. More... | |
bool | SetValueByString (const char *value, int nType=-1) |
set the value by string and type More... | |
string | GetValueByString () |
serialize the current value to a string according to the curren type. More... | |
const string & | GetName () const |
get parameter name. More... | |
void | SetName (const string &sName) |
set parameter name. More... | |
char * | GetRawData () |
raw data bytes | |
int | GetRawDataLength () |
raw data bytes | |
void | SetRawData (const char *data, int nSize) |
set raw data bytes | |
operator int () | |
operator bool () | |
operator DWORD () | |
operator float () | |
operator Vector2 () | |
operator Vector3 () | |
operator Vector4 () | |
operator Matrix4 () | |
operator LPTextureEntity () | |
CParameter & | operator= (const int &r) |
CParameter & | operator= (const bool &r) |
CParameter & | operator= (const float &r) |
CParameter & | operator= (const Vector2 &r) |
CParameter & | operator= (const Vector3 &r) |
CParameter & | operator= (const Vector4 &r) |
CParameter & | operator= (const Matrix4 &r) |
CParameter & | operator= (const LPTextureEntity &r) |
Public Attributes | |
string | m_sName |
string name of the parameter | |
vector< char > | m_data |
PARAMETER_TYPE | m_type |
a name, value pair.
mainly used in Para effect parameter block. value can be integer, float, vector3, vector4, matrix, TextureEntity, etc.
|
inline |
get parameter name.
std::string ParaEngine::CParameter::GetValueByString | ( | ) |
serialize the current value to a string according to the curren type.
|
inline |
set parameter name.
ParaEngine::CParameter::PARAMETER_TYPE ParaEngine::CParameter::SetTypeByString | ( | const char * | sType | ) |
set parameter type by string.
if string is not recognized, the type will be unknown.
sType | one of the "unknown", "int", "boolean", "float", "vector2", "vector3","vector4","matrix43", "texture", "rawbytes" |
bool ParaEngine::CParameter::SetValueByString | ( | const char * | value, |
int | nType = -1 |
||
) |
set the value by string and type
value | string presentation of the value. |
nType | if -1, the current type is used, otherwise the given type is used. |