SmartFoxServer 2X C++ API
LeaveRoomRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of LeaveRoomRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __LeaveRoomRequest__
12 #define __LeaveRoomRequest__
13 
14 #include "../Util/Common.h"
15 #include "BaseRequest.h"
16 #include "../Entities/Room.h"
17 
18 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
19 
20 #if defined(_MSC_VER)
21 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
22 #endif
23 #include <list> // STL library: list object
24 #include <string> // STL library: string object
25 using namespace std; // STL library: declare the STL namespace
26 
27 using namespace Sfs2X::Entities;
28 
29 namespace Sfs2X {
30 namespace Requests {
31 
35  class DLLImportExport LeaveRoomRequest : public BaseRequest
36  {
37  public:
38 
39  // -------------------------------------------------------------------
40  // Public methods
41  // -------------------------------------------------------------------
42 
72  LeaveRoomRequest(boost::shared_ptr<Room> room);
73 
78 
79  virtual ~LeaveRoomRequest();
80 
81  void Validate(boost::shared_ptr<SmartFox> sfs);
82 
83  void Execute (boost::shared_ptr<SmartFox> sfs);
84 
85  // -------------------------------------------------------------------
86  // Public members
87  // -------------------------------------------------------------------
88 
89  static boost::shared_ptr<string> KEY_ROOM_ID;
90 
91  protected:
92 
93  // -------------------------------------------------------------------
94  // Protected methods
95  // -------------------------------------------------------------------
96 
97  // -------------------------------------------------------------------
98  // Protected members
99  // -------------------------------------------------------------------
100 
101  private:
102 
103  // -------------------------------------------------------------------
104  // Private methods
105  // -------------------------------------------------------------------
106  void Init(boost::shared_ptr<Room> room);
107 
108  // -------------------------------------------------------------------
109  // Private members
110  // -------------------------------------------------------------------
111  boost::shared_ptr<Room> room;
112  };
113 
114 } // namespace Requests
115 } // namespace Sfs2X
116 
117 #endif
Leaves a currently joined Room
Definition: LeaveRoomRequest.h:35
STL namespace.
Definition: Buddy.h:30
Definition: SmartFox.cpp:24