src/core/ref-count-base.h
changeset 3393 10369bf4b3e2
parent 3392 775777e52833
child 3395 3b6bc7a4f975
equal deleted inserted replaced
3392:775777e52833 3393:10369bf4b3e2
    57    * conjunction with the Ptr template which would make calling Ref
    57    * conjunction with the Ptr template which would make calling Ref
    58    * unecessary and dangerous.
    58    * unecessary and dangerous.
    59    */
    59    */
    60   inline void Unref (void) const;
    60   inline void Unref (void) const;
    61 
    61 
       
    62   /**
       
    63    * Get the reference count of the object.  Normally not needed; for language bindings.
       
    64    */
       
    65   inline uint32_t GetReferenceCount (void) const;
       
    66 
    62 private:
    67 private:
    63   // Note we make this mutable so that the const methods can still
    68   // Note we make this mutable so that the const methods can still
    64   // change it.
    69   // change it.
    65   mutable uint32_t m_count;  // Reference count
    70   mutable uint32_t m_count;  // Reference count
    66 };
    71 };
    84     { // All references removed, ok to delete
    89     { // All references removed, ok to delete
    85       delete this;
    90       delete this;
    86     }
    91     }
    87 }
    92 }
    88 
    93 
       
    94 uint32_t
       
    95 RefCountBase::GetReferenceCount (void) const
       
    96 {
       
    97   return m_count;
       
    98 }
       
    99 
    89 } // namespace ns3
   100 } // namespace ns3
    90 
   101 
    91 #endif /* __REF_COUNT_BASE_H__*/
   102 #endif /* __REF_COUNT_BASE_H__*/