SmartFoxServer 2X C++ API
ExtensionRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of ExtensionRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __ExtensionRequest__
12 #define __ExtensionRequest__
13 
14 #include "../Util/Common.h"
15 #include "BaseRequest.h"
16 #include "../Entities/Room.h"
17 #include "../Entities/Data/ISFSObject.h"
18 
19 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
20 
21 #if defined(_MSC_VER)
22 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
23 #endif
24 #include <list> // STL library: list object
25 using namespace std; // STL library: declare the STL namespace
26 
27 using namespace Sfs2X::Entities;
28 using namespace Sfs2X::Entities::Data;
29 
30 namespace Sfs2X {
31 namespace Requests {
32 
43  class DLLImportExport ExtensionRequest : public BaseRequest
44  {
45  public:
46 
47  // -------------------------------------------------------------------
48  // Public methods
49  // -------------------------------------------------------------------
50 
102  ExtensionRequest(string extCmd, boost::shared_ptr<ISFSObject> parameters, boost::shared_ptr<Room> room, bool useUDP);
103 
107  ExtensionRequest(string extCmd, boost::shared_ptr<ISFSObject> parameters, boost::shared_ptr<Room> room);
108 
112  ExtensionRequest(string extCmd, boost::shared_ptr<ISFSObject> parameters);
113 
114  virtual ~ExtensionRequest();
115 
116  bool UseUDP();
117  void Validate(boost::shared_ptr<SmartFox> sfs);
118  void Execute (boost::shared_ptr<SmartFox> sfs);
119 
120  // -------------------------------------------------------------------
121  // Public members
122  // -------------------------------------------------------------------
123 
124  static boost::shared_ptr<string> KEY_CMD;
125  static boost::shared_ptr<string> KEY_PARAMS;
126  static boost::shared_ptr<string> KEY_ROOM;
127 
128  protected:
129 
130  // -------------------------------------------------------------------
131  // Protected methods
132  // -------------------------------------------------------------------
133 
134  // -------------------------------------------------------------------
135  // Protected members
136  // -------------------------------------------------------------------
137 
138  private:
139 
140  // -------------------------------------------------------------------
141  // Private methods
142  // -------------------------------------------------------------------
143  void Init(string extCmd, boost::shared_ptr<ISFSObject> parameters, boost::shared_ptr<Room> room, bool useUDP);
144 
145  // -------------------------------------------------------------------
146  // Private members
147  // -------------------------------------------------------------------
148 
149  boost::shared_ptr<string> extCmd;
150  boost::shared_ptr<ISFSObject> parameters;
151  boost::shared_ptr<Room> room;
152  bool useUDP;
153 
154  };
155 
156 } // namespace Requests
157 } // namespace Sfs2X
158 
159 #endif
STL namespace.
Definition: Buddy.h:30
Definition: SmartFox.cpp:24
Definition: ISFSArray.h:17
Sends a request to a Zone or Room Extension.
Definition: ExtensionRequest.h:43