SmartFoxServer 2X C++ API
FindUsersRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of FindUsersRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __FindUsersRequest__
12 #define __FindUsersRequest__
13 
14 #include "../Util/Common.h"
15 #include "BaseRequest.h"
16 #include "../Entities/User.h"
17 #include "../Entities/Room.h"
18 #include "../Entities/Match/MatchExpression.h"
19 
20 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
21 
22 #if defined(_MSC_VER)
23 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
24 #endif
25 #include <list> // STL library: list object
26 #include <string> // STL library: string object
27 using namespace std; // STL library: declare the STL namespace
28 
29 using namespace Sfs2X::Entities::Match;
30 
31 namespace Sfs2X {
32 namespace Requests {
33 
37  class DLLImportExport FindUsersRequest : public BaseRequest
38  {
39  public:
40 
41  // -------------------------------------------------------------------
42  // Public methods
43  // -------------------------------------------------------------------
44  void Init(boost::shared_ptr<MatchExpression> expr);
45  void Init(boost::shared_ptr<MatchExpression> expr, boost::shared_ptr<Room> target, long int limit);
46  void Init(boost::shared_ptr<MatchExpression> expr, string target, long int limit);
47 
51  FindUsersRequest(boost::shared_ptr<MatchExpression> expr);
52 
56  FindUsersRequest(boost::shared_ptr<MatchExpression> expr, boost::shared_ptr<Room> target);
57 
61  FindUsersRequest(boost::shared_ptr<MatchExpression> expr, boost::shared_ptr<Room> target, long int limit);
62 
66  FindUsersRequest(boost::shared_ptr<MatchExpression> expr, string target);
67 
114  FindUsersRequest(boost::shared_ptr<MatchExpression> expr, string target, long int limit);
115 
116  virtual ~FindUsersRequest();
117 
118  void Validate(boost::shared_ptr<SmartFox> sfs);
119 
120  void Execute (boost::shared_ptr<SmartFox> sfs);
121 
122  // -------------------------------------------------------------------
123  // Public members
124  // -------------------------------------------------------------------
125 
126  static boost::shared_ptr<string> KEY_EXPRESSION;
127 
128  static boost::shared_ptr<string> KEY_GROUP;
129 
130  static boost::shared_ptr<string> KEY_ROOM;
131 
132  static boost::shared_ptr<string> KEY_LIMIT;
133 
134  static boost::shared_ptr<string> KEY_FILTERED_USERS;
135 
136  protected:
137 
138  // -------------------------------------------------------------------
139  // Protected methods
140  // -------------------------------------------------------------------
141 
142  // -------------------------------------------------------------------
143  // Protected members
144  // -------------------------------------------------------------------
145 
146  private:
147 
148  // -------------------------------------------------------------------
149  // Private methods
150  // -------------------------------------------------------------------
151 
152  // -------------------------------------------------------------------
153  // Private members
154  // -------------------------------------------------------------------
155  boost::shared_ptr<MatchExpression> matchExpr;
156  boost::shared_ptr<Room> targetRoom;
157  boost::shared_ptr<string> targetString;
158  long int limit;
159  };
160 
161 } // namespace Requests
162 } // namespace Sfs2X
163 
164 #endif
Search Users in the system by matching their variables and properties against a MatchExpression ...
Definition: FindUsersRequest.h:37
STL namespace.
Definition: BoolMatch.cpp:15
Definition: SmartFox.cpp:24