From ad3f75dc81efc8818786c32d6190e3ed069b9fc6 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Thu, 16 Oct 2014 05:49:46 -0400 Subject: dev: Use shared_ptr for EthPacketData This patch transitions the EthPacketData from the ad-hoc RefCountingPtr to the c++11 shared_ptr. There are no changes in behaviour, and the code modifications are mainly replacing "new" with "make_shared". The bool casting operator for the shared_ptr is explicit, and we must therefore either cast it, compare it to NULL (p != nullptr), double negate it (!!p) or do a (p ? true : false). --- src/dev/etherpkt.hh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/dev/etherpkt.hh') diff --git a/src/dev/etherpkt.hh b/src/dev/etherpkt.hh index c71d9cc30..16576d329 100644 --- a/src/dev/etherpkt.hh +++ b/src/dev/etherpkt.hh @@ -40,14 +40,13 @@ #include #include -#include "base/refcnt.hh" #include "base/types.hh" /* * Reference counted class containing ethernet packet data */ class Checkpoint; -class EthPacketData : public RefCounted +class EthPacketData { public: /* @@ -81,6 +80,6 @@ class EthPacketData : public RefCounted const std::string §ion); }; -typedef RefCountingPtr EthPacketPtr; +typedef std::shared_ptr EthPacketPtr; #endif // __ETHERPKT_HH__ -- cgit v1.2.3