diff options
author | dknn <yoann.blein@free.fr> | 2012-06-02 16:50:10 (GMT) |
---|---|---|
committer | dknn <yoann.blein@free.fr> | 2012-09-22 08:39:46 (GMT) |
commit | 8e2195fce7f7905ae63525239428a3634d3c4de1 (patch) | |
tree | a1e1ea4438754fc824f8748d0982b86f5a287b12 | |
parent | fa9b881e10e7cab8495909818cc61519d24d6117 (diff) | |
download | swift-contrib-8e2195fce7f7905ae63525239428a3634d3c4de1.zip swift-contrib-8e2195fce7f7905ae63525239428a3634d3c4de1.tar.bz2 |
Code arrangement based on feedback from Kev
-rw-r--r-- | Swiften/Elements/RTPPayloadType.h | 86 | ||||
-rw-r--r-- | Swiften/Parser/PayloadParsers/RTPPayloadTypeParser.h | 20 |
2 files changed, 53 insertions, 53 deletions
diff --git a/Swiften/Elements/RTPPayloadType.h b/Swiften/Elements/RTPPayloadType.h index e61f921..4e737ee 100644 --- a/Swiften/Elements/RTPPayloadType.h +++ b/Swiften/Elements/RTPPayloadType.h @@ -15,48 +15,48 @@ namespace Swift { -class RTPPayloadType : public Payload { -public: - typedef boost::shared_ptr<RTPPayloadType> ref; - typedef std::map<std::string, std::string> ParameterMap; - -public: - RTPPayloadType(boost::uint8_t id = 0, const std::string& name = "", boost::uint32_t clockrate = 0, - boost::uint8_t channels = 1, boost::uint32_t ptime = 0, boost::uint32_t maxptime = 0) : - m_id(id), m_name(name), m_clockrate(clockrate), m_channels(channels), m_ptime(ptime), m_maxptime(maxptime) {} - - void setChannels(boost::uint32_t channels) { m_channels = channels; } - boost::uint32_t getChannels() const { return m_channels; } - - void setClockrate(boost::uint32_t clockrate) { m_clockrate = clockrate; } - boost::uint32_t getClockrate() const { return m_clockrate; } - - void setID(boost::uint8_t id) { m_id = id; } - boost::uint8_t getID() const { return m_id; } - - void setMaxptime(boost::uint32_t maxptime) { m_maxptime = maxptime; } - boost::uint32_t getMaxptime() const { return m_maxptime; } - - void setName(const std::string& name) { m_name = name; } - const std::string& getName() const { return m_name; } - - void setPTime(boost::uint32_t ptime) { m_ptime = ptime; } - boost::uint32_t getPTime() const { return m_ptime; } - - bool addParameter(const std::string& name, const std::string& value) { - return parameters.insert(std::make_pair(name, value)).second; - } - - const ParameterMap& getParameters() const { return parameters; } - -private: - boost::uint8_t m_id; - std::string m_name; - boost::uint32_t m_clockrate; - boost::uint8_t m_channels; - boost::uint32_t m_ptime; - boost::uint32_t m_maxptime; - ParameterMap parameters; -}; + class RTPPayloadType : public Payload { + public: + typedef boost::shared_ptr<RTPPayloadType> ref; + typedef std::map<std::string, std::string> ParameterMap; + + public: + RTPPayloadType(boost::uint8_t id = 0, const std::string& name = "", boost::uint32_t clockrate = 0, + boost::uint8_t channels = 1, boost::uint32_t ptime = 0, boost::uint32_t maxptime = 0) : + id(id), name(name), clockrate(clockrate), channels(channels), ptime(ptime), maxptime(maxptime) {} + + void setChannels(boost::uint32_t channels) { this->channels = channels; } + boost::uint32_t getChannels() const { return this->channels; } + + void setClockrate(boost::uint32_t clockrate) { this->clockrate = clockrate; } + boost::uint32_t getClockrate() const { return this->clockrate; } + + void setID(boost::uint8_t id) { this->id = id; } + boost::uint8_t getID() const { return this->id; } + + void setMaxptime(boost::uint32_t maxptime) { this->maxptime = maxptime; } + boost::uint32_t getMaxptime() const { return this->maxptime; } + + void setName(const std::string& name) { this->name = name; } + const std::string& getName() const { return this->name; } + + void setPTime(boost::uint32_t ptime) { this->ptime = ptime; } + boost::uint32_t getPTime() const { return this->ptime; } + + bool addParameter(const std::string& name, const std::string& value) { + return parameters.insert(std::make_pair(name, value)).second; + } + + const ParameterMap& getParameters() const { return parameters; } + + private: + boost::uint8_t id; + std::string name; + boost::uint32_t clockrate; + boost::uint8_t channels; + boost::uint32_t ptime; + boost::uint32_t maxptime; + ParameterMap parameters; + }; } diff --git a/Swiften/Parser/PayloadParsers/RTPPayloadTypeParser.h b/Swiften/Parser/PayloadParsers/RTPPayloadTypeParser.h index 360053f..6d566d6 100644 --- a/Swiften/Parser/PayloadParsers/RTPPayloadTypeParser.h +++ b/Swiften/Parser/PayloadParsers/RTPPayloadTypeParser.h @@ -11,16 +11,16 @@ namespace Swift { -class RTPPayloadTypeParser : public GenericPayloadParser<RTPPayloadType> { - public: - RTPPayloadTypeParser(); + class RTPPayloadTypeParser : public GenericPayloadParser<RTPPayloadType> { + public: + RTPPayloadTypeParser(); - virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); - virtual void handleEndElement(const std::string& element, const std::string&); - virtual void handleCharacterData(const std::string&) {}; - - private: - int level; -}; + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string&) {}; + + private: + int level; + }; } |