CSLVariantProxy Class Reference

#include <SL_Variant.h>

List of all members.

Public Types

enum   EValueType {
  SI_SLVT_INVALID = 0,
  SI_SLVT_BOOL,
  SI_SLVT_BYTE,
  SI_SLVT_UBYTE,
  SI_SLVT_DOUBLE,
  SI_SLVT_FLOAT,
  SI_SLVT_INT,
  SI_SLVT_LONG,
  SI_SLVT_ULONG,
  SI_SLVT_SHORT,
  SI_SLVT_STRING
}
  Type of the contained parameter. More...

Public Member Functions

  CSLVariantProxy ()
  ~CSLVariantProxy ()
  Destructor.
SI_Error  Connect (CdotXSITemplate *in_pTemplate, SI_Int in_nIndex)
  CSLVariantProxy (CdotXSITemplate *in_pTemplate, SI_Int in_nIndex)
EValueType  GetType () const
SI_Error  GetValue (SI_TinyVariant &out_Variant) const
SI_Error  SetValue (const SI_TinyVariant &in_vVariant)
SI_Error  SetValue (const CSLVariantProxy &in_vVariant)
SI_Error  GetTinyVarType (SI_Int &out_VariantType) const

Static Public Member Functions

static SI_Error  TinyVarType2SLVarType (const SI_TinyVariant &in_TinyVariant, EValueType &out_Type)

Public Attributes

union {
   CSLBoolProxy *   m_pBool
   CSLByteProxy *   m_pByte
   CSLUByteProxy *   m_pUByte
   CSLDoubleProxy *   m_pDouble
   CSLFloatProxy *   m_pFloat
   CSLIntProxy *   m_pInt
   CSLLongProxy *   m_pLong
   CSLULongProxy *   m_pULong
   CSLShortProxy *   m_pShort
   CSLStringProxy *   m_pString
}; 


Detailed Description

Class that allows the modification of any type of parameter in a template
Note:
A specialized proxy should be used whenever possible in order to limit unnecessary conversion.
See also:
CSLBoolProxy

CSLByteProxy

CSLDoubleProxy

CSLEnumProxy

CSLStrEnumProxy

CSLFloatProxy

CSLIntProxy

CSLLongProxy

CSLStringProxy

CSLUByteProxy

CSLULongProxy


Member Enumeration Documentation

enum EValueType

Type of the contained parameter.

Enumerator:
SI_SLVT_INVALID  Invalid type. The default value for unconnected variant.
See also:
CSLVariantProxy::Connect
SI_SLVT_BOOL  CSLBoolProxy type
SI_SLVT_BYTE  CSLByteProxy type
SI_SLVT_UBYTE  CSLUByteProxy type
SI_SLVT_DOUBLE  CSLDoubleProxy type
SI_SLVT_FLOAT  CSLFloatProxy type
SI_SLVT_INT  CSLIntProxy type
SI_SLVT_LONG  CSLLongProxy type
SI_SLVT_ULONG  CSLULongProxy type
SI_SLVT_SHORT  CSLShortProxy type
SI_SLVT_STRING  CSLStringProxy type


Constructor & Destructor Documentation

CSLVariantProxy (  ) 

Default constructor.

Note:
This constructor does not call CSLVariantProxy::Connect and will set the variant type to CSLVariant::SI_SLVT_INVALID.

CSLVariantProxy ( CdotXSITemplate in_pTemplate,
SI_Int  in_nIndex  
)

Constructor that connects to a parameter in a template

Parameters:
in_pTemplate  Template containing the parameter to connect to
in_nIndex  Index of the parameter to connect to


Member Function Documentation

SI_Error Connect ( CdotXSITemplate in_pTemplate,
SI_Int  in_nIndex  
)

Connects the variant to a parameter in a template

Parameters:
in_pTemplate  Template containing the parameter to connect to
in_nIndex  Index of the parameter to connect to
Note:
Once connected, you can modify the parameter's value trough this proxy.

EValueType GetType (  )  const

Gets the type of the parameter referred by this proxy

SI_Error GetValue ( SI_TinyVariant out_Variant  )  const

Gets the value of the parameter referred by this proxy

Parameters:
out_Variant  The value of the parameter
Return values:
SI_SUCCESS  Got the value of the parameter
SI_ERR_BAD_ARGUMENT  Failed to get the value of the variant. This happens when CSLVariantProxy::Connect failed or wasn't called (i.e. The type of the variant is CSLVariantProxy::SI_SLVT_INVALID );
Warning:
You must not free the string pointer of SI_SLVT_STRING

SI_Error SetValue ( const SI_TinyVariant in_vVariant  ) 

Sets the value of the parameter referred by this proxy

Parameters:
in_vVariant  Value to put.
Return values:
SI_SUCCESS  Value was set
SI_ERR_BAD_ARGUMENT  The value types don't match or the proxy isn't connected
See also:
CSLVariantProxy::Connect

CSLVariantProxy::TinyVarType2SLVarType

SI_Error SetValue ( const CSLVariantProxy in_vVariant  ) 

Sets the value of the parameter referred by this proxy

Parameters:
in_vVariant  Value to put.
Return values:
SI_SUCCESS  Value was set
SI_ERR_BAD_ARGUMENT  The value types don't match or the proxy isn't connected
See also:
CSLVariantProxy::Connect

CSLVariantProxy::TinyVarType2SLVarType

static SI_Error TinyVarType2SLVarType ( const SI_TinyVariant in_TinyVariant,
EValueType out_Type  
) [static]

Returns the equivalent CSLVariantProxy::EValueType of a given SI_TinyVariant

Parameters:
in_TinyVariant  The tiny variant with the type to extract
out_Type  The equivalent type in CSLVariantProxy::EValueType.
Return values:
SI_SUCCESS  Equivalent variant type found and put in out_Type
SI_ERR_BAD_ARGUMENT  The SI_TinyVariant has no equivalent CSLVariantProxy::EValueType.

SI_Error GetTinyVarType ( SI_Int &  out_VariantType  )  const

Gets the equivalent SI_TinyVariant variant type for this instance

Parameters:
out_VariantType  The equivalent SI_TinyVariant variant type
Return values:
SI_SUCCESS  Equivalent variant type found and put in out_VariantType
SI_ERR_BAD_ARGUMENT  The proxy is unconnected or failed to connect
See also:
CSLVariantProxy::Connect


Member Data Documentation

CSLBoolProxy* m_pBool

CSLVariant::SI_SLVT_BOOL

CSLByteProxy* m_pByte

CSLVariant::SI_SLVT_BYTE

CSLUByteProxy* m_pUByte

CSLVariant::SI_SLVT_UBYTE

CSLDoubleProxy* m_pDouble

CSLVariant::SI_SLVT_DOUBLE

CSLFloatProxy* m_pFloat

CSLVariant::SI_SLVT_FLOAT

CSLIntProxy* m_pInt

CSLVariant::SI_SLVT_INT

CSLLongProxy* m_pLong

CSLVariant::SI_SLVT_LONG

CSLULongProxy* m_pULong

CSLVariant::SI_SLVT_ULONG

CSLShortProxy* m_pShort

CSLVariant::SI_SLVT_SHORT

CSLStringProxy* m_pString

CSLVariant::SI_SLVT_STRING

union { ... }

Pointer to the contained parameter

Warning:
You must acces the pointer that matches the variant type defined by CSLVariantProxy::EValueType.
See also:
CSLVariant::GetType

CSLVariant::GetValue

CSLVariant::SetValue


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