SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
Loading...
Searching...
No Matches
sfs3::entities::BuddyVariable Class Referenceabstract

A custom value attached to a buddy in a buddy list, kept in sync between client and server. More...

#include <Variable.h>

Inheritance diagram for sfs3::entities::BuddyVariable:
[legend]

Public Member Functions

virtual bool isOffline ()=0
 Checks if this is a "offline" variable (persistent), which is available to other Users even when the client is not online.
Public Member Functions inherited from sfs3::entities::Variable
std::string name ()
virtual const VarDatavalue ()
 Returns the value of this variable, whatever its type.
virtual std::optional< bool > boolValue ()
virtual std::optional< uint8_t > byteValue ()
virtual std::optional< int16_t > shortValue ()
virtual std::optional< int32_t > intValue ()
virtual std::optional< int64_t > longValue ()
virtual std::optional< float > floatValue ()
virtual std::optional< double > doubleValue ()
virtual std::optional< std::string > stringValue ()
virtual std::shared_ptr< SFSObjectsfsObjectValue ()
virtual std::shared_ptr< SFSArraysfsArrayValue ()
virtual std::optional< SFSVector2vector2Value ()
virtual std::optional< SFSVector3vector3Value ()
virtual void setNull ()
 Clears the value of this variable.
virtual void setValue (VarData value)
 Sets the value of this variable.
virtual bool isNull ()
virtual std::string toString ()

Detailed Description

A custom value attached to a buddy in a buddy list, kept in sync between client and server.

SFSBuddyVariable is the standard implementation of this interface.

See also
SFSBuddyVariable
requests::buddy::SetBuddyVariablesRequest

Member Function Documentation

◆ isOffline()

virtual bool sfs3::entities::BuddyVariable::isOffline ( )
pure virtual

Checks if this is a "offline" variable (persistent), which is available to other Users even when the client is not online.

There is no setter counterpart: a Buddy Variable is persistent by virtue of its own name starting with SFSBuddyVariable::OFFLINE_PREFIX, which is the only thing the server honours. Name it accordingly at construction to make it persistent.

Returns
true if the variable is persistent

Implemented in sfs3::entities::SFSBuddyVariable.


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