|
|
- #ifndef MW_MAP_I_H
- #define MW_MAP_I_H
-
- #include <Ice/Ice.h>
- #include <MW.h>
- #include <set>
-
- class MWMapCallbackAdapter
- {
- public:
- virtual void init(Ice::StringSeq) = 0;
- virtual void join(const std::shared_ptr<MW::UserJoinedEvent>&) = 0;
- virtual void leave(const std::shared_ptr<MW::UserLeftEvent>&) = 0;
- virtual void send(const std::shared_ptr<MW::PositionEvent>&) = 0;
- };
-
- class MWMap
- {
- public:
- MWMap(bool trace, const std::shared_ptr<Ice::Logger>& logger);
- void reserve(const std::string&);
- void unreserve(const std::string&);
- void join(const std::string&, const std::shared_ptr<MWMapCallbackAdapter>&);
- void leave(const std::string&);
- long long send(const std::string&, std::string);
-
- private:
-
- using MWMapCallbackMap = std::map<std::string, std::shared_ptr<MWMapCallbackAdapter>>;
-
- MWMapCallbackMap _members;
- std::set<std::string> _reserved;
- std::mutex _mutex;
- const bool _trace;
- const std::shared_ptr<Ice::Logger> _logger;
- };
-
- #endif
|