SmartFoxServer 2X C++ API
Sfs2X::Entities::Buddy Class Referenceabstract

SFSBuddy More...

#include <Buddy.h>

Inheritance diagram for Sfs2X::Entities::Buddy:
Sfs2X::Entities::SFSBuddy

Public Member Functions

virtual long int Id ()=0
 The id of the Buddy More...
 
virtual void Id (long int value)=0
 The id of the Buddy More...
 
virtual boost::shared_ptr< string > Name ()=0
 The name of the Buddy More...
 
virtual bool IsBlocked ()=0
 Return true if the Buddy is blocked in the current Users' BuddyList More...
 
virtual void IsBlocked (bool value)=0
 Return true if the Buddy is blocked in the current Users' BuddyList More...
 
virtual bool IsOnline ()=0
 Return true if the User is online in the BuddyList system More...
 
virtual bool IsTemp ()=0
 Return true if the Buddy is temporary (not persistent) More...
 
virtual boost::shared_ptr< string > State ()=0
 The current Buddy custom state (e.g. "Available", "Busy", etc...) More...
 
virtual boost::shared_ptr< string > NickName ()=0
 An optional Buddy nickname More...
 
virtual boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > > Variables ()=0
 Obtain a list of BuddyVariables. More...
 
virtual boost::shared_ptr< BuddyVariable > GetVariable (string varName)=0
 Get the BuddyVariable with the provided name. More...
 
virtual bool ContainsVariable (string varName)=0
 Return true if a BuddyVariable with the provided name exists More...
 
virtual boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > > GetOfflineVariables ()=0
 Return a list of offline Buddy Variables More...
 
virtual boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > > GetOnlineVariables ()=0
 Return a list of non-persistent Buddy Variables More...
 

Detailed Description

Member Function Documentation

◆ ContainsVariable()

virtual bool Sfs2X::Entities::Buddy::ContainsVariable ( string  varName)
pure virtual

Return true if a BuddyVariable with the provided name exists

Parameters
varNameA string
Returns
A boolean

Implemented in Sfs2X::Entities::SFSBuddy.

◆ GetOfflineVariables()

virtual boost::shared_ptr<vector<boost::shared_ptr<BuddyVariable> > > Sfs2X::Entities::Buddy::GetOfflineVariables ( )
pure virtual

Return a list of offline Buddy Variables

Returns
A vector of BuddyVariable pointers

Implemented in Sfs2X::Entities::SFSBuddy.

◆ GetOnlineVariables()

virtual boost::shared_ptr<vector<boost::shared_ptr<BuddyVariable> > > Sfs2X::Entities::Buddy::GetOnlineVariables ( )
pure virtual

Return a list of non-persistent Buddy Variables

Returns
A vector of BuddyVariable pointers

Implemented in Sfs2X::Entities::SFSBuddy.

◆ GetVariable()

virtual boost::shared_ptr<BuddyVariable> Sfs2X::Entities::Buddy::GetVariable ( string  varName)
pure virtual

Get the BuddyVariable with the provided name.

Null is returned if not BuddyVariable exists with that name

Parameters
varNameA string
Returns
Pointer to a BuddyVariable instance

Implemented in Sfs2X::Entities::SFSBuddy.

◆ Id() [1/2]

virtual long int Sfs2X::Entities::Buddy::Id ( )
pure virtual

The id of the Buddy

The id corresponds to the current id of the User in the system

Implemented in Sfs2X::Entities::SFSBuddy.

◆ Id() [2/2]

virtual void Sfs2X::Entities::Buddy::Id ( long int  value)
pure virtual

The id of the Buddy

The id corresponds to the current id of the User in the system

Implemented in Sfs2X::Entities::SFSBuddy.

◆ IsBlocked() [1/2]

virtual bool Sfs2X::Entities::Buddy::IsBlocked ( )
pure virtual

Return true if the Buddy is blocked in the current Users' BuddyList

See also
Requests.BlockBuddyRequest

Implemented in Sfs2X::Entities::SFSBuddy.

◆ IsBlocked() [2/2]

virtual void Sfs2X::Entities::Buddy::IsBlocked ( bool  value)
pure virtual

Return true if the Buddy is blocked in the current Users' BuddyList

See also
Requests.BlockBuddyRequest

Implemented in Sfs2X::Entities::SFSBuddy.

◆ IsOnline()

virtual bool Sfs2X::Entities::Buddy::IsOnline ( )
pure virtual

Return true if the User is online in the BuddyList system

The value is stored in a reserved Buddy Variable

See also
Requests.GoOnlineRequest, ReservedBuddyVariables

Implemented in Sfs2X::Entities::SFSBuddy.

◆ IsTemp()

virtual bool Sfs2X::Entities::Buddy::IsTemp ( )
pure virtual

Return true if the Buddy is temporary (not persistent)

Implemented in Sfs2X::Entities::SFSBuddy.

◆ Name()

virtual boost::shared_ptr<string> Sfs2X::Entities::Buddy::Name ( )
pure virtual

The name of the Buddy

Implemented in Sfs2X::Entities::SFSBuddy.

◆ NickName()

virtual boost::shared_ptr<string> Sfs2X::Entities::Buddy::NickName ( )
pure virtual

An optional Buddy nickname

The value is stored in a reserved Buddy Variable

See also
ReservedBuddyVariables

Implemented in Sfs2X::Entities::SFSBuddy.

◆ State()

virtual boost::shared_ptr<string> Sfs2X::Entities::Buddy::State ( )
pure virtual

The current Buddy custom state (e.g. "Available", "Busy", etc...)

The value is stored in a reserved Buddy Variable

See also
ReservedBuddyVariables

Implemented in Sfs2X::Entities::SFSBuddy.

◆ Variables()

virtual boost::shared_ptr<vector<boost::shared_ptr<BuddyVariable> > > Sfs2X::Entities::Buddy::Variables ( )
pure virtual

Obtain a list of BuddyVariables.

Please note that by convention any variable whose name starts with the dollar sign ($) will be regarded as persistent and stored locally by the server.

These variables are also referred to as "offline variables" because they are available to other Users even when the Buddy is offline.

See also
SFSBuddyVariable, Requests.SetBuddyVariablesRequest

Implemented in Sfs2X::Entities::SFSBuddy.