/* * 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 #include #include #include #include #include #include #include namespace Swift { class JingleContent : public Payload { public: typedef boost::shared_ptr ref; enum Creator { InitiatorCreator, ResponderCreator, }; /*enum Senders { NoSenders, InitiatorSender, ResponderSender, BothSenders, };*/ void setCreator(Creator creator) { this->creator = creator; } void setName(const String& name) { this->name = name; } const std::vector& getDescriptions() const { return descriptions; } void addDescription(JingleDescription::ref description) { descriptions.push_back(description); } const std::vector& getTransports() const { return transports; } void addTransport(JingleTransport::ref transport) { transports.push_back(transport); } template boost::shared_ptr getDescription() const { foreach (JingleDescription::ref i, descriptions) { boost::shared_ptr result(boost::dynamic_pointer_cast(i)); if (result) { return result; } } return boost::shared_ptr(); } template boost::shared_ptr getTransport() const { foreach (JingleTransport::ref i, transports) { boost::shared_ptr result(boost::dynamic_pointer_cast(i)); if (result) { return result; } } return boost::shared_ptr(); } private: Creator creator; String name; //Senders senders; std::vector descriptions; std::vector transports; }; }