constify refcounted object base class

Mathieu Lacage 2007-05-03 00:23:23 +02:00
parent 4a90819ba6
commit 66780ca8aa
2 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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