SmartFoxServer 2X C++ API
SFSRoomVariable.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of SFSRoomVariable
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __SFSRoomVariable__
12 #define __SFSRoomVariable__
13 
14 #include "../../Util/Common.h"
15 #include "BaseVariable.h"
16 #include "RoomVariable.h"
17 #include "../Data/ISFSArray.h"
18 
19 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
20 
21 using namespace Sfs2X::Entities::Data;
22 
23 namespace Sfs2X {
24 namespace Entities {
25 namespace Variables {
26 
54  class DLLImportExport SFSRoomVariable : public BaseVariable, public RoomVariable
55  {
56  public:
57 
58  // -------------------------------------------------------------------
59  // Public methods
60  // -------------------------------------------------------------------
61 
62  static boost::shared_ptr<RoomVariable> FromSFSArray(boost::shared_ptr<ISFSArray> sfsa);
63 
75  SFSRoomVariable(string name, boost::shared_ptr<long int> val);
76  SFSRoomVariable(string name, boost::shared_ptr<unsigned long int> val);
77  SFSRoomVariable(string name, boost::shared_ptr<int> val);
78  SFSRoomVariable(string name, boost::shared_ptr<unsigned int> val);
79  SFSRoomVariable(string name, boost::shared_ptr<bool> val);
80  SFSRoomVariable(string name, boost::shared_ptr<double> val);
81  SFSRoomVariable(string name, boost::shared_ptr<string> val);
82  SFSRoomVariable(string name, boost::shared_ptr<SFSObject> val);
83  SFSRoomVariable(string name, boost::shared_ptr<SFSArray> val);
84 
94  SFSRoomVariable(string name, boost::shared_ptr<void> val, long int type);
95 
96  virtual ~SFSRoomVariable();
97 
98  bool IsPrivate();
99  void IsPrivate(bool value);
100 
101  bool IsPersistent();
102  void IsPersistent(bool value);
103 
104  boost::shared_ptr<string> ToString();
105  boost::shared_ptr<ISFSArray> ToSFSArray();
106 
107  boost::shared_ptr<string> Name();
108  VariableType Type();
109  boost::shared_ptr<void> Value();
110  boost::shared_ptr<bool> GetBoolValue();
111  boost::shared_ptr<long int> GetIntValue();
112  boost::shared_ptr<double> GetDoubleValue();
113  boost::shared_ptr<string> GetStringValue();
114  boost::shared_ptr<ISFSObject> GetSFSObjectValue();
115  boost::shared_ptr<ISFSArray> GetSFSArrayValue();
116  bool IsNull();
117 
118  // -------------------------------------------------------------------
119  // Public members
120  // -------------------------------------------------------------------
121 
122  protected:
123 
124  // -------------------------------------------------------------------
125  // Protected methods
126  // -------------------------------------------------------------------
127 
128  // -------------------------------------------------------------------
129  // Protected members
130  // -------------------------------------------------------------------
131 
132  private:
133 
134  // -------------------------------------------------------------------
135  // Private methods
136  // -------------------------------------------------------------------
137 
138  // -------------------------------------------------------------------
139  // Private members
140  // -------------------------------------------------------------------
141 
142  bool isPersistent;
143  bool isPrivate;
144  };
145 
146 } // namespace Variables
147 } // namespace Entities
148 } // namespace Sfs2X
149 
150 #endif
The BaseVariable object is the base class for all SmartFoxServer Variable entities on the client...
Definition: BaseVariable.h:47
The RoomVariable class is used to represent variables maintained on the Server side and automatically...
Definition: SFSRoomVariable.h:54
Definition: SmartFox.cpp:24
Definition: ISFSArray.h:17