提交 fcec549d authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

C++: make const all the Dump() methods (really fixes #69)

上级 07f4e78d
...@@ -34,7 +34,7 @@ namespace RTC ...@@ -34,7 +34,7 @@ namespace RTC
IceCandidate(RTC::UdpSocket* udpSocket, uint32_t priority); IceCandidate(RTC::UdpSocket* udpSocket, uint32_t priority);
IceCandidate(RTC::TcpServer* tcpServer, uint32_t priority); IceCandidate(RTC::TcpServer* tcpServer, uint32_t priority);
Json::Value toJson(); Json::Value toJson() const;
private: private:
// Others. // Others.
......
...@@ -29,7 +29,7 @@ namespace RTC { namespace RTCP ...@@ -29,7 +29,7 @@ namespace RTC { namespace RTCP
/* Pure virtual methods inherited from Packet. */ /* Pure virtual methods inherited from Packet. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetCount() const override; virtual size_t GetCount() const override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -16,7 +16,7 @@ namespace RTC { namespace RTCP ...@@ -16,7 +16,7 @@ namespace RTC { namespace RTCP
size_t GetSize() const; size_t GetSize() const;
size_t GetSenderReportCount() const; size_t GetSenderReportCount() const;
size_t GetReceiverReportCount() const; size_t GetReceiverReportCount() const;
void Dump(); void Dump() const;
void AddSenderReport(SenderReport* report); void AddSenderReport(SenderReport* report);
void AddReceiverReport(ReceiverReport* report); void AddReceiverReport(ReceiverReport* report);
void AddSdesChunk(SdesChunk* chunk); void AddSdesChunk(SdesChunk* chunk);
......
...@@ -35,7 +35,7 @@ namespace RTC { namespace RTCP ...@@ -35,7 +35,7 @@ namespace RTC { namespace RTCP
/* Pure virtual methods inherited from Packet. */ /* Pure virtual methods inherited from Packet. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetCount() const override; virtual size_t GetCount() const override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -14,7 +14,7 @@ namespace RTC { namespace RTCP ...@@ -14,7 +14,7 @@ namespace RTC { namespace RTCP
virtual ~FeedbackItem(); virtual ~FeedbackItem();
public: public:
virtual void Dump() = 0; virtual void Dump() const = 0;
virtual void Serialize(); virtual void Serialize();
virtual size_t Serialize(uint8_t* buffer) = 0; virtual size_t Serialize(uint8_t* buffer) = 0;
virtual size_t GetSize() const = 0; virtual size_t GetSize() const = 0;
......
...@@ -28,7 +28,7 @@ namespace RTC { namespace RTCP ...@@ -28,7 +28,7 @@ namespace RTC { namespace RTCP
/* Pure virtual methods inherited from Packet. */ /* Pure virtual methods inherited from Packet. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -22,7 +22,7 @@ namespace RTC { namespace RTCP ...@@ -22,7 +22,7 @@ namespace RTC { namespace RTCP
/* Pure virtual methods inherited from Packet. */ /* Pure virtual methods inherited from Packet. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -46,7 +46,7 @@ namespace RTC { namespace RTCP ...@@ -46,7 +46,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -40,7 +40,7 @@ namespace RTC { namespace RTCP ...@@ -40,7 +40,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -19,7 +19,7 @@ namespace RTC { namespace RTCP ...@@ -19,7 +19,7 @@ namespace RTC { namespace RTCP
virtual ~FeedbackPsPliPacket() {}; virtual ~FeedbackPsPliPacket() {};
public: public:
virtual void Dump() override; virtual void Dump() const override;
}; };
/* Inline instance methods. */ /* Inline instance methods. */
......
...@@ -53,7 +53,7 @@ namespace RTC { namespace RTCP ...@@ -53,7 +53,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -45,7 +45,7 @@ namespace RTC { namespace RTCP ...@@ -45,7 +45,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -49,7 +49,7 @@ namespace RTC { namespace RTCP ...@@ -49,7 +49,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -55,7 +55,7 @@ namespace RTC { namespace RTCP ...@@ -55,7 +55,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -28,7 +28,7 @@ namespace RTC { namespace RTCP ...@@ -28,7 +28,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -62,7 +62,7 @@ namespace RTC { namespace RTCP ...@@ -62,7 +62,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -42,7 +42,7 @@ namespace RTC { namespace RTCP ...@@ -42,7 +42,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -18,7 +18,7 @@ namespace RTC { namespace RTCP ...@@ -18,7 +18,7 @@ namespace RTC { namespace RTCP
FeedbackRtpSrReqPacket(uint32_t sender_ssrc, uint32_t media_ssrc); FeedbackRtpSrReqPacket(uint32_t sender_ssrc, uint32_t media_ssrc);
virtual ~FeedbackRtpSrReqPacket() {}; virtual ~FeedbackRtpSrReqPacket() {};
virtual void Dump() override; virtual void Dump() const override;
}; };
/* Inline instance methods. */ /* Inline instance methods. */
......
...@@ -42,7 +42,7 @@ namespace RTC { namespace RTCP ...@@ -42,7 +42,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -49,7 +49,7 @@ namespace RTC { namespace RTCP ...@@ -49,7 +49,7 @@ namespace RTC { namespace RTCP
/* Virtual methods inherited from FeedbackItem. */ /* Virtual methods inherited from FeedbackItem. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -65,7 +65,7 @@ namespace RTC { namespace RTCP ...@@ -65,7 +65,7 @@ namespace RTC { namespace RTCP
const uint8_t* GetData() const; const uint8_t* GetData() const;
public: public:
virtual void Dump() = 0; virtual void Dump() const = 0;
virtual size_t Serialize(uint8_t* buffer) = 0; virtual size_t Serialize(uint8_t* buffer) = 0;
virtual size_t GetCount() const = 0; virtual size_t GetCount() const = 0;
virtual size_t GetSize() const = 0; virtual size_t GetSize() const = 0;
......
...@@ -34,7 +34,7 @@ namespace RTC { namespace RTCP ...@@ -34,7 +34,7 @@ namespace RTC { namespace RTCP
// Locally generated Report. Holds the data internally. // Locally generated Report. Holds the data internally.
ReceiverReport(); ReceiverReport();
void Dump(); void Dump() const;
size_t Serialize(uint8_t* buffer); size_t Serialize(uint8_t* buffer);
size_t GetSize() const; size_t GetSize() const;
uint32_t GetSsrc() const; uint32_t GetSsrc() const;
...@@ -78,7 +78,7 @@ namespace RTC { namespace RTCP ...@@ -78,7 +78,7 @@ namespace RTC { namespace RTCP
/* Pure virtual methods inherited from Packet. */ /* Pure virtual methods inherited from Packet. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetCount() const override; virtual size_t GetCount() const override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -44,7 +44,7 @@ namespace RTC { namespace RTCP ...@@ -44,7 +44,7 @@ namespace RTC { namespace RTCP
SdesItem(Type type, size_t len, const char* value); SdesItem(Type type, size_t len, const char* value);
~SdesItem(); ~SdesItem();
void Dump(); void Dump() const;
size_t Serialize(uint8_t* buffer); size_t Serialize(uint8_t* buffer);
size_t GetSize() const; size_t GetSize() const;
...@@ -74,7 +74,7 @@ namespace RTC { namespace RTCP ...@@ -74,7 +74,7 @@ namespace RTC { namespace RTCP
explicit SdesChunk(SdesChunk* chunk); explicit SdesChunk(SdesChunk* chunk);
~SdesChunk(); ~SdesChunk();
void Dump(); void Dump() const;
void Serialize(); void Serialize();
size_t Serialize(uint8_t* buffer); size_t Serialize(uint8_t* buffer);
size_t GetSize() const; size_t GetSize() const;
...@@ -108,7 +108,7 @@ namespace RTC { namespace RTCP ...@@ -108,7 +108,7 @@ namespace RTC { namespace RTCP
/* Pure virtual methods inherited from Packet. */ /* Pure virtual methods inherited from Packet. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetCount() const override; virtual size_t GetCount() const override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -32,7 +32,7 @@ namespace RTC { namespace RTCP ...@@ -32,7 +32,7 @@ namespace RTC { namespace RTCP
// Locally generated Report. Holds the data internally. // Locally generated Report. Holds the data internally.
SenderReport(); SenderReport();
void Dump(); void Dump() const;
size_t Serialize(uint8_t* buffer); size_t Serialize(uint8_t* buffer);
size_t GetSize() const; size_t GetSize() const;
uint32_t GetSsrc() const; uint32_t GetSsrc() const;
...@@ -72,7 +72,7 @@ namespace RTC { namespace RTCP ...@@ -72,7 +72,7 @@ namespace RTC { namespace RTCP
/* Pure virtual methods inherited from Packet. */ /* Pure virtual methods inherited from Packet. */
public: public:
virtual void Dump() override; virtual void Dump() const override;
virtual size_t Serialize(uint8_t* buffer) override; virtual size_t Serialize(uint8_t* buffer) override;
virtual size_t GetCount() const override; virtual size_t GetCount() const override;
virtual size_t GetSize() const override; virtual size_t GetSize() const override;
......
...@@ -73,7 +73,7 @@ namespace RTC ...@@ -73,7 +73,7 @@ namespace RTC
} }
} }
Json::Value IceCandidate::toJson() Json::Value IceCandidate::toJson() const
{ {
static const Json::StaticString k_foundation("foundation"); static const Json::StaticString k_foundation("foundation");
static const Json::StaticString k_priority("priority"); static const Json::StaticString k_priority("priority");
......
...@@ -84,7 +84,7 @@ namespace RTC { namespace RTCP ...@@ -84,7 +84,7 @@ namespace RTC { namespace RTCP
return offset+padding; return offset+padding;
} }
void ByePacket::Dump() void ByePacket::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -71,7 +71,7 @@ namespace RTC { namespace RTCP ...@@ -71,7 +71,7 @@ namespace RTC { namespace RTCP
this->sdesPacket.Serialize(this->header + offset); this->sdesPacket.Serialize(this->header + offset);
} }
void CompoundPacket::Dump() void CompoundPacket::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -79,7 +79,7 @@ namespace RTC { namespace RTCP ...@@ -79,7 +79,7 @@ namespace RTC { namespace RTCP
} }
template <typename T> template <typename T>
void FeedbackPacket<T>::Dump() void FeedbackPacket<T>::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -67,7 +67,7 @@ namespace RTC { namespace RTCP ...@@ -67,7 +67,7 @@ namespace RTC { namespace RTCP
} }
template<typename Item> template<typename Item>
void FeedbackPsItemPacket<Item>::Dump() void FeedbackPsItemPacket<Item>::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -38,7 +38,7 @@ namespace RTC { namespace RTCP ...@@ -38,7 +38,7 @@ namespace RTC { namespace RTCP
return offset + this->size; return offset + this->size;
} }
void FeedbackPsAfbPacket::Dump() void FeedbackPsAfbPacket::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -52,7 +52,7 @@ namespace RTC { namespace RTCP ...@@ -52,7 +52,7 @@ namespace RTC { namespace RTCP
return sizeof(Header); return sizeof(Header);
} }
void FirItem::Dump() void FirItem::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -46,7 +46,7 @@ namespace RTC { namespace RTCP ...@@ -46,7 +46,7 @@ namespace RTC { namespace RTCP
return sizeof(Header); return sizeof(Header);
} }
void PsLeiItem::Dump() void PsLeiItem::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -25,7 +25,7 @@ namespace RTC { namespace RTCP ...@@ -25,7 +25,7 @@ namespace RTC { namespace RTCP
return packet.release(); return packet.release();
} }
void FeedbackPsPliPacket::Dump() void FeedbackPsPliPacket::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -91,7 +91,7 @@ namespace RTC { namespace RTCP ...@@ -91,7 +91,7 @@ namespace RTC { namespace RTCP
return sizeof(Header); return sizeof(Header);
} }
void RpsiItem::Dump() void RpsiItem::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -52,7 +52,7 @@ namespace RTC { namespace RTCP ...@@ -52,7 +52,7 @@ namespace RTC { namespace RTCP
return sizeof(Header); return sizeof(Header);
} }
void SliItem::Dump() void SliItem::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -54,7 +54,7 @@ namespace RTC { namespace RTCP ...@@ -54,7 +54,7 @@ namespace RTC { namespace RTCP
} }
template <typename T> template <typename T>
void TstItem<T>::Dump() void TstItem<T>::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -62,7 +62,7 @@ namespace RTC { namespace RTCP ...@@ -62,7 +62,7 @@ namespace RTC { namespace RTCP
return offset+padding; return offset+padding;
} }
void VbcmItem::Dump() void VbcmItem::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -65,7 +65,7 @@ namespace RTC { namespace RTCP ...@@ -65,7 +65,7 @@ namespace RTC { namespace RTCP
} }
template<typename Item> template<typename Item>
void FeedbackRtpItemPacket<Item>::Dump() void FeedbackRtpItemPacket<Item>::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -36,7 +36,7 @@ namespace RTC { namespace RTCP ...@@ -36,7 +36,7 @@ namespace RTC { namespace RTCP
return sizeof(Header); return sizeof(Header);
} }
void EcnItem::Dump() void EcnItem::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -47,7 +47,7 @@ namespace RTC { namespace RTCP ...@@ -47,7 +47,7 @@ namespace RTC { namespace RTCP
return sizeof(Header); return sizeof(Header);
} }
void NackItem::Dump() void NackItem::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -24,7 +24,7 @@ namespace RTC { namespace RTCP ...@@ -24,7 +24,7 @@ namespace RTC { namespace RTCP
return new FeedbackRtpSrReqPacket(commonHeader); return new FeedbackRtpSrReqPacket(commonHeader);
} }
void FeedbackRtpSrReqPacket::Dump() void FeedbackRtpSrReqPacket::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -46,7 +46,7 @@ namespace RTC { namespace RTCP ...@@ -46,7 +46,7 @@ namespace RTC { namespace RTCP
return sizeof(Header); return sizeof(Header);
} }
void TlleiItem::Dump() void TlleiItem::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -77,7 +77,7 @@ namespace RTC { namespace RTCP ...@@ -77,7 +77,7 @@ namespace RTC { namespace RTCP
} }
template <typename T> template <typename T>
void TmmbItem<T>::Dump() void TmmbItem<T>::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -30,7 +30,7 @@ namespace RTC { namespace RTCP ...@@ -30,7 +30,7 @@ namespace RTC { namespace RTCP
/* Instance methods. */ /* Instance methods. */
void ReceiverReport::Dump() void ReceiverReport::Dump() const
{ {
MS_TRACE(); MS_TRACE();
...@@ -115,7 +115,7 @@ namespace RTC { namespace RTCP ...@@ -115,7 +115,7 @@ namespace RTC { namespace RTCP
return offset; return offset;
} }
void ReceiverReportPacket::Dump() void ReceiverReportPacket::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -72,7 +72,7 @@ namespace RTC { namespace RTCP ...@@ -72,7 +72,7 @@ namespace RTC { namespace RTCP
std::memcpy(this->header->value, value, this->header->length); std::memcpy(this->header->value, value, this->header->length);
} }
void SdesItem::Dump() void SdesItem::Dump() const
{ {
MS_TRACE(); MS_TRACE();
...@@ -159,7 +159,7 @@ namespace RTC { namespace RTCP ...@@ -159,7 +159,7 @@ namespace RTC { namespace RTCP
return offset+padding; return offset+padding;
} }
void SdesChunk::Dump() void SdesChunk::Dump() const
{ {
MS_TRACE(); MS_TRACE();
...@@ -217,7 +217,7 @@ namespace RTC { namespace RTCP ...@@ -217,7 +217,7 @@ namespace RTC { namespace RTCP
return offset; return offset;
} }
void SdesPacket::Dump() void SdesPacket::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
...@@ -29,7 +29,7 @@ namespace RTC { namespace RTCP ...@@ -29,7 +29,7 @@ namespace RTC { namespace RTCP
/* Instance methods. */ /* Instance methods. */
void SenderReport::Dump() void SenderReport::Dump() const
{ {
MS_TRACE(); MS_TRACE();
...@@ -90,7 +90,7 @@ namespace RTC { namespace RTCP ...@@ -90,7 +90,7 @@ namespace RTC { namespace RTCP
return offset; return offset;
} }
void SenderReportPacket::Dump() void SenderReportPacket::Dump() const
{ {
MS_TRACE(); MS_TRACE();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论