#include <jabberdlib.h>
Public Member Functions | |
| pointer () | |
| pointer (pointed_type *pointed_object, bool malloc_allocated=false) | |
| pointer (const pointer< pointed_type > &src) | |
| ~pointer () | |
| void | delete_object () |
| pointer< pointed_type > & | operator= (const pointer< pointed_type > &src) |
| pointed_type & | operator* () |
| pointed_type * | operator-> () const |
| bool | points_to_NULL () const |
the pointer template class is used as a replacement for real pointers
Instead of real pointers this template class should be used everywhere inside this package. Managed pointers have the advantage, that they track for you if the object pointed to does still exist.
| xmppd::pointer< pointed_type >::pointer | ( | ) |
constructor to create a managed pointer pointing to nothing
| xmppd::pointer< pointed_type >::pointer | ( | pointed_type * | pointed_object, | |
| bool | malloc_allocated = false | |||
| ) |
constructor to create a managed pointer for a real pointer
After constructing a managed pointer, the freeing of the pointed_object is done by the managed pointer. Therefore the caller should not free the pointed_object itself.
| pointed_object | the object a managed pointer should be created for | |
| malloc_allocated | if false, the pointed_object is deleted using the delete operator (default); if true, the pointed object is deleted using std::free() |
| xmppd::pointer< pointed_type >::pointer | ( | const pointer< pointed_type > & | src | ) |
copy constructor
Makes a copy of a managed pointer to an object.
| src | the copy source |
| xmppd::pointer< pointed_type >::~pointer | ( | ) |
destruct a pointer
Destructs a pointer, and if it is the last pointer to the object, it deletes (or frees) the object
| void xmppd::pointer< pointed_type >::delete_object | ( | ) |
delete the object the pointer points to
This marks all managed pointers pointing to this object as pointing to nothing.
| pointed_type& xmppd::pointer< pointed_type >::operator* | ( | ) |
dereference operator
Dereferences a managed pointer (i.e. gives access to the object the managed pointer points to)
| pointed_type* xmppd::pointer< pointed_type >::operator-> | ( | ) | const |
pointer operator
| pointer<pointed_type>& xmppd::pointer< pointed_type >::operator= | ( | const pointer< pointed_type > & | src | ) |
assignment operator
Assignes the value of another managed pointer to a managed pointer
| src | the object, that gets assigned to this managed pointer |
| bool xmppd::pointer< pointed_type >::points_to_NULL | ( | ) | const |
check if this pointer points to nothing
1.6.3