OpenTTD Source
20240919-master-gdf0233f4c2
|
Simple counted object. More...
#include <countedptr.hpp>
Public Member Functions | |
virtual int32_t | AddRef () |
virtual int32_t | Release () |
virtual void | FinalRelease () |
Data Fields | |
int32_t | m_ref_cnt |
Simple counted object.
Use it as base of your struct/class if you want to use basic reference counting. Your struct/class will destroy and free itself when last reference to it is released (using Release() method). The initial reference count (when it is created) is zero (don't forget AddRef() at least one time if not using CCountedPtr<T>.
Definition at line 198 of file countedptr.hpp.