SmartFoxServer 2X C++ API
FindRoomsRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of FindRoomsRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __FindRoomsRequest__
12 #define __FindRoomsRequest__
13 
14 #include "../Util/Common.h"
15 #include "BaseRequest.h"
16 #include "../Entities/Room.h"
17 #include "../Entities/Match/MatchExpression.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 #include <string> // STL library: string object
26 using namespace std; // STL library: declare the STL namespace
27 
28 using namespace Sfs2X::Entities::Match;
29 
30 namespace Sfs2X {
31 namespace Requests {
32 
36  class DLLImportExport FindRoomsRequest : public BaseRequest
37  {
38  public:
39 
40  // -------------------------------------------------------------------
41  // Public methods
42  // -------------------------------------------------------------------
43 
47  FindRoomsRequest(boost::shared_ptr<MatchExpression> expr);
48 
52  FindRoomsRequest(boost::shared_ptr<MatchExpression> expr, string groupId);
53 
93  FindRoomsRequest(boost::shared_ptr<MatchExpression> expr, string groupId, long int limit);
94 
95  virtual ~FindRoomsRequest();
96 
97  void Validate(boost::shared_ptr<SmartFox> sfs);
98 
99  void Execute (boost::shared_ptr<SmartFox> sfs);
100 
101  // -------------------------------------------------------------------
102  // Public members
103  // -------------------------------------------------------------------
104 
105  static boost::shared_ptr<string> KEY_EXPRESSION;
106 
107  static boost::shared_ptr<string> KEY_GROUP;
108 
109  static boost::shared_ptr<string> KEY_LIMIT;
110 
111  static boost::shared_ptr<string> KEY_FILTERED_ROOMS;
112 
113  protected:
114 
115  // -------------------------------------------------------------------
116  // Protected methods
117  // -------------------------------------------------------------------
118 
119  // -------------------------------------------------------------------
120  // Protected members
121  // -------------------------------------------------------------------
122 
123  private:
124 
125  // -------------------------------------------------------------------
126  // Private methods
127  // -------------------------------------------------------------------
128  void Init(boost::shared_ptr<MatchExpression> expr, string groupId, long int limit);
129 
130  // -------------------------------------------------------------------
131  // Private members
132  // -------------------------------------------------------------------
133  boost::shared_ptr<MatchExpression> matchExpr;
134  boost::shared_ptr<string> groupId;
135  long int limit;
136  };
137 
138 } // namespace Requests
139 } // namespace Sfs2X
140 
141 #endif
Search Rooms in the system by matching their variables and properties against a MatchExpression ...
Definition: FindRoomsRequest.h:36
STL namespace.
Definition: BoolMatch.cpp:15
Definition: SmartFox.cpp:24