diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-01-29 17:48:13 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-01-29 18:45:34 (GMT) |
commit | 869c52b244c2d03313e9eda83fac05bf0fc3a619 (patch) | |
tree | 63f0518e15d0c23ece6eb55733c2ef44f710bf01 /Swiften/Jingle/JingleSessionManager.h | |
parent | 11a7f5c48ea9c90e9adaaa06a96e0a9116234bff (diff) | |
download | swift-contrib-869c52b244c2d03313e9eda83fac05bf0fc3a619.zip swift-contrib-869c52b244c2d03313e9eda83fac05bf0fc3a619.tar.bz2 |
Added some experimental Jingle classes.
Diffstat (limited to 'Swiften/Jingle/JingleSessionManager.h')
-rw-r--r-- | Swiften/Jingle/JingleSessionManager.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Swiften/Jingle/JingleSessionManager.h b/Swiften/Jingle/JingleSessionManager.h new file mode 100644 index 0000000..ea4199d --- /dev/null +++ b/Swiften/Jingle/JingleSessionManager.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2011 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include <boost/shared_ptr.hpp> +#include <map> + +#include <Swiften/Base/boost_bsignals.h> +#include <Swiften/Jingle/IncomingJingleSession.h> + +namespace Swift { + class IQRouter; + class JingleResponder; + class IncomingJingleSessionHandler; + + class JingleSessionManager { + friend class JingleResponder; + public: + JingleSessionManager(IQRouter* router); + ~JingleSessionManager(); + + JingleSession::ref getSession(const JID& jid, const String& id) const; + + void addIncomingSessionHandler(IncomingJingleSessionHandler* handler); + void removeIncomingSessionHandler(IncomingJingleSessionHandler* handler); + + protected: + void handleIncomingSession(const JID& from, IncomingJingleSession::ref); + + private: + IQRouter* router; + JingleResponder* responder; + std::vector<IncomingJingleSessionHandler*> incomingSessionHandlers; + struct JIDSession { + JIDSession(const JID& jid, const String& session) : jid(jid), session(session) {} + bool operator<(const JIDSession& o) const { + return jid == o.jid ? session < o.session : jid < o.jid; + } + JID jid; + String session; + }; + typedef std::map<JIDSession, JingleSession::ref> SessionMap; + SessionMap incomingSessions; + }; +} |