My Project
Public Types | Public Member Functions | Public Attributes | List of all members
ParaEngine::CParameter Class Reference

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 TextureEntityLPTextureEntity
 

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 ()
 
CParameteroperator= (const int &r)
 
CParameteroperator= (const bool &r)
 
CParameteroperator= (const float &r)
 
CParameteroperator= (const Vector2 &r)
 
CParameteroperator= (const Vector3 &r)
 
CParameteroperator= (const Vector4 &r)
 
CParameteroperator= (const Matrix4 &r)
 
CParameteroperator= (const LPTextureEntity &r)
 

Public Attributes

string m_sName
 string name of the parameter
 
vector< char > m_data
 
PARAMETER_TYPE m_type
 

Detailed Description

a name, value pair.

mainly used in Para effect parameter block. value can be integer, float, vector3, vector4, matrix, TextureEntity, etc.

Member Function Documentation

§ GetName()

const string& ParaEngine::CParameter::GetName ( ) const
inline

get parameter name.

§ GetValueByString()

std::string ParaEngine::CParameter::GetValueByString ( )

serialize the current value to a string according to the curren type.

§ SetName()

void ParaEngine::CParameter::SetName ( const string &  sName)
inline

set parameter name.

§ SetTypeByString()

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.

Parameters
sTypeone of the "unknown", "int", "boolean", "float", "vector2", "vector3","vector4","matrix43", "texture", "rawbytes"
Returns
: the integer type is returned.

§ SetValueByString()

bool ParaEngine::CParameter::SetValueByString ( const char *  value,
int  nType = -1 
)

set the value by string and type

Parameters
valuestring presentation of the value.
nTypeif -1, the current type is used, otherwise the given type is used.
Returns
: true if succeed

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