constify refcounted object base class
This commit is contained in:
1 parent
4a90819ba6
commit
66780ca8aa
2 files changed
+7
-7
No files matched your search
+3
-3
@@ -35,7 +35,7 @@ Object::~Object ()
|
||||
}
|
||||
|
||||
void
|
||||
Object::Ref (void)
|
||||
Object::Ref (void) const
|
||||
{
|
||||
NS_DEBUG("Object::Ref (): this == 0x" << this);
|
||||
m_count++;
|
||||
@@ -43,7 +43,7 @@ Object::Ref (void)
|
||||
}
|
||||
|
||||
void
|
||||
Object::Unref (void)
|
||||
Object::Unref (void) const
|
||||
{
|
||||
NS_DEBUG("Object::Unref (): this == 0x" << this);
|
||||
m_count--;
|
||||
@@ -57,7 +57,7 @@ Object::Unref (void)
|
||||
}
|
||||
|
||||
bool
|
||||
Object::IsSingle (void)
|
||||
Object::IsSingle (void) const
|
||||
{
|
||||
NS_DEBUG("Object::IsSingle (): m_count == " << m_count);
|
||||
return m_count == 1;
|
||||
|
||||
+4
-4
@@ -30,12 +30,12 @@ class Object
|
||||
public:
|
||||
Object ();
|
||||
virtual ~Object ();
|
||||
void Ref (void);
|
||||
void Unref (void);
|
||||
bool IsSingle (void);
|
||||
void Ref (void) const;
|
||||
void Unref (void) const;
|
||||
bool IsSingle (void) const;
|
||||
virtual void Dispose (void);
|
||||
private:
|
||||
uint32_t m_count;
|
||||
mutable uint32_t m_count;
|
||||
};
|
||||
|
||||
}//namespace ns3
|
||||
|
||||
Reference in new issue
Block a user