SmartFoxServer 2X C++ API
Buddy.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of Buddy interface
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __Buddy__
12 #define __Buddy__
13 
14 #include "../Util/Common.h"
15 #include "Variables/BuddyVariable.h"
16 
17 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
18 
19 #if defined(_MSC_VER)
20 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
21 #endif
22 #include <string> // STL library: string object
23 #include <list> // STL library: list object
24 #include <vector> // STL library: vector object
25 using namespace std; // STL library: declare the STL namespace
26 
27 using namespace Sfs2X::Entities::Variables;
28 
29 namespace Sfs2X {
30 namespace Entities {
31 
35  class DLLImportExport Buddy
36  {
37  public:
44  virtual long int Id() = 0;
45 
52  virtual void Id(long int value) = 0;
53 
57  virtual boost::shared_ptr<string> Name() = 0;
58 
63  virtual bool IsBlocked() = 0;
64 
69  virtual void IsBlocked(bool value) = 0;
70 
80  virtual bool IsOnline() = 0;
81 
85  virtual bool IsTemp() = 0;
86 
94  virtual boost::shared_ptr<string> State() = 0;
95 
103  virtual boost::shared_ptr<string> NickName() = 0;
104 
117  virtual boost::shared_ptr<vector<boost::shared_ptr<BuddyVariable> > > Variables() = 0;
118 
131  virtual boost::shared_ptr<BuddyVariable> GetVariable(string varName) = 0;
132 
142  virtual bool ContainsVariable(string varName) = 0;
143 
150  virtual boost::shared_ptr<vector<boost::shared_ptr<BuddyVariable> > > GetOfflineVariables() = 0;
151 
158  virtual boost::shared_ptr<vector<boost::shared_ptr<BuddyVariable> > > GetOnlineVariables() = 0;
159 
160  virtual void SetVariable(boost::shared_ptr<BuddyVariable> bVar) = 0;
161 
162  virtual void SetVariables(boost::shared_ptr<vector<boost::shared_ptr<BuddyVariable> > > variables) = 0;
163 
164  virtual void RemoveVariable(string varName) = 0;
165 
166  virtual void ClearVolatileVariables() = 0;
167  };
168 
169 } // namespace Entities
170 } // namespace Sfs2X
171 
172 #endif
SFSBuddy
Definition: Buddy.h:35
STL namespace.
Definition: BaseVariable.cpp:15
Definition: SmartFox.cpp:24