SmartFoxServer 2X C++ API
Sfs2X::Entities::Variables::BaseVariable Class Reference

The BaseVariable object is the base class for all SmartFoxServer Variable entities on the client. More...

#include <BaseVariable.h>

Inheritance diagram for Sfs2X::Entities::Variables::BaseVariable:
Sfs2X::Entities::Variables::Variable Sfs2X::Entities::Variables::MMOItemVariable Sfs2X::Entities::Variables::SFSBuddyVariable Sfs2X::Entities::Variables::SFSRoomVariable Sfs2X::Entities::Variables::SFSUserVariable

Public Member Functions

 BaseVariable (string name, boost::shared_ptr< void > val, long int type)
 Creates a new BaseVariable instance. More...
 
 BaseVariable (string name, boost::shared_ptr< long int > val)
 Creates a new BaseVariable instance. More...
 
virtual boost::shared_ptr< string > Name ()
 Indicates the name of this variable.
 
virtual VariableType Type ()
 Indicates the type of this variable.
 
virtual boost::shared_ptr< void > Value ()
 Returns the untyped value of this variable.
 
virtual boost::shared_ptr< bool > GetBoolValue ()
 Retrieves the value of a boolean variable.
 
virtual boost::shared_ptr< long int > GetIntValue ()
 Retrieves the value of an integer variable.
 
virtual boost::shared_ptr< double > GetDoubleValue ()
 Retrieves the value of a double precision variable.
 
virtual boost::shared_ptr< string > GetStringValue ()
 Retrieves the value of a string variable.
 
virtual boost::shared_ptr< ISFSObjectGetSFSObjectValue ()
 Retrieves the value of a SFSObject variable.
 
virtual boost::shared_ptr< ISFSArrayGetSFSArrayValue ()
 Retrieves the value of a SFSArray variable.
 
virtual bool IsNull ()
 Indicates if the variable is null.
 
virtual boost::shared_ptr< ISFSArrayToSFSArray ()
 <exclude>
 

Detailed Description

Constructor & Destructor Documentation

◆ BaseVariable() [1/2]

Sfs2X::Entities::Variables::BaseVariable::BaseVariable ( string  name,
boost::shared_ptr< void >  val,
long int  type 
)

Creates a new BaseVariable instance.

Parameters
nameThe name of the Variable.
valThe value of the Variable.
typeThe type of the Variable among those available in the VariableType class. Usually it is not necessary to pass this parameter, as the type is auto-detected from the value.

<exclude>

◆ BaseVariable() [2/2]

Sfs2X::Entities::Variables::BaseVariable::BaseVariable ( string  name,
boost::shared_ptr< long int >  val 
)

Creates a new BaseVariable instance.

Parameters
nameThe name of the Variable.
valThe value of the Variable ( can be Boolean, int, Number, String, SFSObject, SFSArray ).

<exclude>