#include <LCore/RefCountPtr.h>
Inheritance diagram for strmod::lcore::RefCountPtr:

Public Types | |
| typedef ReferenceCounting | RC |
Public Methods | |
| RefCountPtr () | |
| Contruct a null pointer. | |
| RefCountPtr (RC *rfptr) | |
| Construct a pointer pointing at rfptr and increment its reference count. | |
| RefCountPtr (const RefCountPtr &b) | |
| Copy a RefCountPtr and incremement the reference count of the thing pointed to. | |
| virtual | ~RefCountPtr () |
| Destroy the pointer and decrement the reference count of the thing pointed to. | |
| virtual int | AreYouA (const lcore::ClassIdent &cid) const |
| Asks if a class is of a particular type, or publicly derived from that type. | |
| RC & | operator * () const |
| Smart pointer operator, if _LCORE_RefCountPtr_H_DEBUG is set, asserts non-null. | |
| RC * | operator-> () const |
| Smart pointer operator, if _LCORE_RefCountPtr_H_DEBUG is set, asserts non-null. | |
| RC * | GetPtr () const |
| What am I pointing at? | |
| void | ReleasePtr (bool deleteref=true) |
| Set me to point at null, decrement the reference count of previous pointer destination. | |
| operator bool () const | |
| Am I non-null? | |
| bool | operator! () const |
| Am I null? | |
| const RefCountPtr & | operator= (const RefCountPtr &b) |
| Copy a reference counted pointer, handling reference counts appropriately. | |
| const RefCountPtr & | operator= (RC *b) |
| Copy from a regular pointer, handling reference counts appropriately. | |
Static Public Attributes | |
| const LCore_ClassIdent | identifier |
| Globally unique identifier for this class. | |
Protected Methods | |
| virtual const ClassIdent * | i_GetIdent () const |
| Returns the class identifier for the class the object actually is. | |
| virtual RC * | i_CheckType (RC *p) const |
| Do some type checking of a ReferenceCounting pointer to make sure it points at the right type. | |
| void | i_SetPtr (ReferenceCounting *p, bool deleteref=true) |
| Change what this RefCountPtr points to, maybe modifying reference counts. | |
There's not much more to this than the brief description says.
Definition at line 58 of file RefCountPtr.h.
|
|
Destroy the pointer and decrement the reference count of the thing pointed to. If the reference count of the thing pointed to goes to 0, its destructor will be called. Definition at line 168 of file RefCountPtr.h. |
|
|
Asks if a class is of a particular type, or publicly derived from that type. Overriden in every derived class (with a static identifier member) to compare against the identifier, then call the AreYouA methods of all the superclasses.
Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::strmod::StrChunkPtr. |
|
|
Do some type checking of a ReferenceCounting pointer to make sure it points at the right type.
Definition at line 130 of file RefCountPtr.h. |
|
|
Returns the class identifier for the class the object actually is. Should always be overridden in any class that has a static identifier member. Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::unievent::EventPtr, and strmod::strmod::StrChunkPtr. Definition at line 123 of file RefCountPtr.h. |
|
||||||||||||
|
Change what this RefCountPtr points to, maybe modifying reference counts. This will properly handle i_SetPtr(GetPtr()). Normally, it will increment the reference count of the new value of the pointer, then decrement the reference count of the old value, possibly deleting the pointed to object if the reference count goes to 0. If deleteref is false, the decrement won't happen.
Definition at line 52 of file rfcntptr.cxx. |
|
|
Copy from a regular pointer, handling reference counts appropriately. This handles *this = this->GetPtr() properly. It decrements the reference count of, and possibly destroys what's currently being pointed at, and increments the reference count of what will be pointed to. This also uses the i_CheckType() function to do some type checking of the pointer being pointed to. This is so new pointer classes with type constraints can be derived from this class. Definition at line 223 of file RefCountPtr.h. |
|
|
Copy a reference counted pointer, handling reference counts appropriately. This handles *this = *this, and *this = ReferenceCounting(*this) properly. It decrements the reference count of, and possibly destroys what's currently being pointed at, and increments the reference count of what will be pointed to. This also uses the i_CheckType() function to do some type checking of the pointer being pointed to. This is so new pointer classes with type constraints can be derived from this class. Definition at line 213 of file RefCountPtr.h. |
|
|
Set me to point at null, decrement the reference count of previous pointer destination. If the reference count of the thing previously pointed to goes to 0, its destructor will be called. Definition at line 198 of file RefCountPtr.h. |
|
|
Globally unique identifier for this class. Every class that might need to be identified should have a public static const identifier object in it. Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::unievent::EventPtr, and strmod::strmod::StrChunkPtr. |
1.3-rc1