SmartFoxServer 2X C++ API
MessageRecipientMode.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of MessageRecipientMode
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __MessageRecipientMode__
12 #define __MessageRecipientMode__
13 
14 #include <boost/exception/exception.hpp>
15 #include <boost/exception/all.hpp>
16 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
17 
18 #include "../Util/Common.h"
19 #include "../Entities/Room.h"
20 #include "../Entities/User.h"
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 <string> // STL library: string object
26 using namespace std; // STL library: declare the STL namespace
27 
28 namespace Sfs2X {
29 namespace Requests {
30 
31  enum MessageRecipientType
32  {
33  MESSAGERECIPIENTTYPE_TO_USER = 0,
34  MESSAGERECIPIENTTYPE_TO_ROOM = 1,
35  MESSAGERECIPIENTTYPE_TO_GROUP = 2,
36  MESSAGERECIPIENTTYPE_TO_ZONE = 3
37  };
38 
53  class DLLImportExport MessageRecipientMode
54  {
55  public:
56 
57  // -------------------------------------------------------------------
58  // Public methods
59  // -------------------------------------------------------------------
60 
70  MessageRecipientMode(long int mode, boost::shared_ptr<User> target);
71  MessageRecipientMode(long int mode, boost::shared_ptr<Room> target);
72  MessageRecipientMode(long int mode, string target);
73  virtual ~MessageRecipientMode();
74 
75  boost::shared_ptr<User> TargetUser();
76  boost::shared_ptr<Room> TargetRoom();
77  boost::shared_ptr<string> TargetString();
78  long int TargetInt();
79  boost::shared_ptr<vector<boost::shared_ptr<User> > > TargetUsersCollection();
80 
81  long int Mode();
82 
83  // -------------------------------------------------------------------
84  // Public members
85  // -------------------------------------------------------------------
86 
87  protected:
88 
89  // -------------------------------------------------------------------
90  // Protected methods
91  // -------------------------------------------------------------------
92 
93  // -------------------------------------------------------------------
94  // Protected members
95  // -------------------------------------------------------------------
96 
97  private:
98 
99  // -------------------------------------------------------------------
100  // Private methods
101  // -------------------------------------------------------------------
102 
103  // -------------------------------------------------------------------
104  // Private members
105  // -------------------------------------------------------------------
106  boost::shared_ptr<User> targetUser;
107  boost::shared_ptr<Room> targetRoom;
108  boost::shared_ptr<string> targetString;
109  boost::shared_ptr<long int> targetInt;
110  boost::shared_ptr<vector<boost::shared_ptr<User> > > targetUsersCollection;
111 
112  long int mode;
113  };
114 
115 } // namespace Requests
116 } // namespace Sfs2X
117 
118 #endif
This class is used to specify the recipient mode for Moderator Messages and Administrator Message...
Definition: MessageRecipientMode.h:53
STL namespace.
Definition: SmartFox.cpp:24