diff options
Diffstat (limited to 'Swiften/Elements/JingleContentPayload.h')
-rw-r--r-- | Swiften/Elements/JingleContentPayload.h | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/Swiften/Elements/JingleContentPayload.h b/Swiften/Elements/JingleContentPayload.h index 5ec2e33..46751fd 100644 --- a/Swiften/Elements/JingleContentPayload.h +++ b/Swiften/Elements/JingleContentPayload.h @@ -18,85 +18,85 @@ #include <Swiften/JID/JID.h> namespace Swift { - class SWIFTEN_API JingleContentPayload : public Payload { - public: - typedef boost::shared_ptr<JingleContentPayload> ref; - - enum Creator { - UnknownCreator, - InitiatorCreator, - ResponderCreator - }; - - JingleContentPayload() : creator(UnknownCreator) { - } - - /*enum Senders { - NoSenders, - InitiatorSender, - ResponderSender, - BothSenders, - };*/ - - Creator getCreator() const { - return creator; - } - - void setCreator(Creator creator) { - this->creator = creator; - } - - const std::string& getName() const { - return name; - } - - void setName(const std::string& name) { - this->name = name; - } - - const std::vector<JingleDescription::ref>& getDescriptions() const { - return descriptions; - } - - void addDescription(JingleDescription::ref description) { - descriptions.push_back(description); - } - - const std::vector<boost::shared_ptr<JingleTransportPayload> >& getTransports() const { - return transports; - } - - void addTransport(boost::shared_ptr<JingleTransportPayload> transport) { - transports.push_back(transport); - } - - template<typename T> - boost::shared_ptr<T> getDescription() const { - for (size_t i = 0; i < descriptions.size(); ++i) { - boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(descriptions[i])); - if (result) { - return result; - } - } - return boost::shared_ptr<T>(); - } - - template<typename T> - boost::shared_ptr<T> getTransport() const { - for (size_t i = 0; i < transports.size(); ++i) { - boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(transports[i])); - if (result) { - return result; - } - } - return boost::shared_ptr<T>(); - } - - private: - Creator creator; - std::string name; - //Senders senders; - std::vector<JingleDescription::ref> descriptions; - std::vector<boost::shared_ptr<JingleTransportPayload> > transports; - }; + class SWIFTEN_API JingleContentPayload : public Payload { + public: + typedef boost::shared_ptr<JingleContentPayload> ref; + + enum Creator { + UnknownCreator, + InitiatorCreator, + ResponderCreator + }; + + JingleContentPayload() : creator(UnknownCreator) { + } + + /*enum Senders { + NoSenders, + InitiatorSender, + ResponderSender, + BothSenders, + };*/ + + Creator getCreator() const { + return creator; + } + + void setCreator(Creator creator) { + this->creator = creator; + } + + const std::string& getName() const { + return name; + } + + void setName(const std::string& name) { + this->name = name; + } + + const std::vector<JingleDescription::ref>& getDescriptions() const { + return descriptions; + } + + void addDescription(JingleDescription::ref description) { + descriptions.push_back(description); + } + + const std::vector<boost::shared_ptr<JingleTransportPayload> >& getTransports() const { + return transports; + } + + void addTransport(boost::shared_ptr<JingleTransportPayload> transport) { + transports.push_back(transport); + } + + template<typename T> + boost::shared_ptr<T> getDescription() const { + for (size_t i = 0; i < descriptions.size(); ++i) { + boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(descriptions[i])); + if (result) { + return result; + } + } + return boost::shared_ptr<T>(); + } + + template<typename T> + boost::shared_ptr<T> getTransport() const { + for (size_t i = 0; i < transports.size(); ++i) { + boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(transports[i])); + if (result) { + return result; + } + } + return boost::shared_ptr<T>(); + } + + private: + Creator creator; + std::string name; + //Senders senders; + std::vector<JingleDescription::ref> descriptions; + std::vector<boost::shared_ptr<JingleTransportPayload> > transports; + }; } |