SmartFoxServer 2X C++ API
|
BuddyVariables are custom values attached to any Buddy in a BuddyList. More...
#include <SFSBuddyVariable.h>
Public Member Functions | |
SFSBuddyVariable (string name, boost::shared_ptr< void > val, long int type) | |
SFSBuddyVariable (boost::shared_ptr< string > name, boost::shared_ptr< void > val, long int type) | |
SFSBuddyVariable (string name, boost::shared_ptr< long int > val) | |
<exclude> | |
boost::shared_ptr< string > | Name () |
Indicates the name of this variable. | |
VariableType | Type () |
Indicates the type of this variable. | |
boost::shared_ptr< void > | Value () |
Returns the untyped value of this variable. | |
boost::shared_ptr< bool > | GetBoolValue () |
Retrieves the value of a boolean variable. | |
boost::shared_ptr< long int > | GetIntValue () |
Retrieves the value of an integer variable. | |
boost::shared_ptr< double > | GetDoubleValue () |
Retrieves the value of a double precision variable. | |
boost::shared_ptr< string > | GetStringValue () |
Retrieves the value of a string variable. | |
boost::shared_ptr< ISFSObject > | GetSFSObjectValue () |
Retrieves the value of a SFSObject variable. | |
boost::shared_ptr< ISFSArray > | GetSFSArrayValue () |
Retrieves the value of a SFSArray variable. | |
bool | IsNull () |
Indicates if the variable is null . | |
virtual boost::shared_ptr< ISFSArray > | ToSFSArray () |
<exclude> | |
boost::shared_ptr< string > | ToString () |
Returns a string that contains the Buddy Variable name, type and value. More... | |
Public Member Functions inherited from Sfs2X::Entities::Variables::BaseVariable | |
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... | |
BuddyVariables are custom values attached to any Buddy in a BuddyList.
They work with the same principle of the User/Room Variables.
The only difference is the logic by which they get propagated to other Users. While RoomVariables are broadcast to all clients in the same Room, BuddyVariables are updated to all Users who have the BuddyVariable owner in their BuddyLists.
BuddyVariables support basic data types and nested complex objects:
Also there is a special convention that allows certain Variables to be "offline" Buddy Variables.
All variable names starting with a dollar sign ($) will set the BuddyVariable as persistent and make them available at any time whether the owner is online or not.
Sfs2X::Entities::Variables::SFSBuddyVariable::SFSBuddyVariable | ( | string | name, |
boost::shared_ptr< void > | val, | ||
long int | type | ||
) |
name | the name of the variable |
val | the variable value ( can be Boolean, int, Number, String, SFSObject, SFSArray ) |
type | it's usually not necessary to pass this parameter as the variable value is auto-detected |
Sfs2X::Entities::Variables::SFSBuddyVariable::SFSBuddyVariable | ( | boost::shared_ptr< string > | name, |
boost::shared_ptr< void > | val, | ||
long int | type | ||
) |
name | the name of the variable |
val | the variable value ( can be Boolean, int, Number, String, SFSObject, SFSArray ) |
type | it's usually not necessary to pass this parameter as the variable value is auto-detected |
boost::shared_ptr< string > Sfs2X::Entities::Variables::SFSBuddyVariable::ToString | ( | ) |
Returns a string that contains the Buddy Variable name, type and value.