SmartFoxServer 2X C++ API
IRoomManager.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of IRoomManager interface
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __IRoomManager__
12 #define __IRoomManager__
13 
14 // Forward class declaration
15 namespace Sfs2X {
16 namespace Entities {
17 namespace Managers {
18  class IRoomManager;
19 } // namespace Managers
20 } // namespace Entities
21 } // namespace Sfs2X
22 
23 #include "../Room.h"
24 #include "../../SmartFox.h"
25 
26 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
27 
28 #if defined(_MSC_VER)
29 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
30 #endif
31 #include <string> // STL library: string object
32 #include <vector> // STL library: vector object
33 using namespace std; // STL library: declare the STL namespace
34 
35 using namespace Sfs2X;
36 using namespace Sfs2X::Entities;
37 
38 namespace Sfs2X {
39 namespace Entities {
40 namespace Managers {
41 
45  class DLLImportExport IRoomManager
46  {
47  public:
48  virtual boost::shared_ptr<string> OwnerZone() = 0;
49  virtual void AddRoom(boost::shared_ptr<Room> room, bool addGroupIfMissing) = 0;
50  virtual void AddRoom(boost::shared_ptr<Room> room) = 0;
51  virtual void AddGroup(string groupId) = 0;
52  virtual boost::shared_ptr<Room> ReplaceRoom(boost::shared_ptr<Room> room, bool addToGroupIfMissing) = 0;
53  virtual boost::shared_ptr<Room> ReplaceRoom(boost::shared_ptr<Room> room) = 0;
54  virtual void RemoveGroup(string groupId) = 0;
55  virtual bool ContainsGroup(string groupId) = 0;
56  virtual bool ContainsRoom(boost::shared_ptr<long int> idOrName) = 0;
57  virtual bool ContainsRoom(boost::shared_ptr<string> idOrName) = 0;
58  virtual bool ContainsRoomInGroup(boost::shared_ptr<long int> idOrName, string groupId) = 0;
59  virtual bool ContainsRoomInGroup(boost::shared_ptr<string> idOrName, string groupId) = 0;
60  virtual void ChangeRoomName(boost::shared_ptr<Room> room, string newName) = 0;
61  virtual void ChangeRoomPasswordState(boost::shared_ptr<Room> room, bool isPassProtected) = 0;
62  virtual void ChangeRoomCapacity(boost::shared_ptr<Room> room, long int maxUsers, long int maxSpect) = 0;
63  virtual boost::shared_ptr<Room> GetRoomById(long int id) = 0;
64  virtual boost::shared_ptr<Room> GetRoomByName(string name) = 0;
65  virtual boost::shared_ptr<vector<boost::shared_ptr<Room> > > GetRoomList() = 0;
66  virtual long int GetRoomCount() = 0;
67  virtual boost::shared_ptr<vector<string> > GetRoomGroups() = 0;
68  virtual boost::shared_ptr<vector<boost::shared_ptr<Room> > > GetRoomListFromGroup(string groupId) = 0;
69  virtual boost::shared_ptr<vector<boost::shared_ptr<Room> > > GetJoinedRooms() = 0;
70  virtual boost::shared_ptr<vector<boost::shared_ptr<Room> > > GetUserRooms(boost::shared_ptr<User> user) = 0;
71  virtual void RemoveRoom(boost::shared_ptr<Room> room) = 0;
72  virtual void RemoveRoomById(long int id) = 0;
73  virtual void RemoveRoomByName(string name) = 0;
74  virtual void RemoveUser(boost::shared_ptr<User> user) = 0;
75  virtual boost::shared_ptr<SmartFox> SmartFoxClient() = 0;
76  virtual void Dispose() = 0;
77  };
78 
79 } // namespace Managers
80 } // namespace Entities
81 } // namespace Sfs2X
82 
83 #endif
STL namespace.
The Room Manager interface
Definition: IRoomManager.h:45
Definition: Buddy.h:30
Definition: SmartFox.cpp:24