xmppd::pointer< pointed_type > Class Template Reference
#include <jabberdlib.h>
Detailed Description
template<class pointed_type>
class xmppd::pointer< pointed_type >
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.
Constructor & Destructor Documentation
template<class pointed_type>
constructor to create a managed pointer pointing to nothing
template<class pointed_type>
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.
- Parameters:
-
| 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() |
template<class pointed_type>
copy constructor
Makes a copy of a managed pointer to an object.
- Parameters:
-
template<class pointed_type>
destruct a pointer
Destructs a pointer, and if it is the last pointer to the object, it deletes (or frees) the object
Member Function Documentation
template<class pointed_type>
delete the object the pointer points to
This marks all managed pointers pointing to this object as pointing to nothing.
template<class pointed_type>
dereference operator
Dereferences a managed pointer (i.e. gives access to the object the managed pointer points to)
- Returns:
- the object the managed pointer points to
template<class pointed_type>
pointer operator
- Note:
- do NOT use this to get back a real pointer to the object. The operator is just there to let you access the object like you are used to do it with real pointers. (i.e. myptr->fieldname)
- Returns:
- the real pointer to the object
template<class pointed_type>
assignment operator
Assignes the value of another managed pointer to a managed pointer
- Parameters:
-
| src | the object, that gets assigned to this managed pointer |
- Returns:
- the managed pointer itself
template<class pointed_type>
check if this pointer points to nothing
- Returns:
- true if the pointer does not point to anything, else false
The documentation for this class was generated from the following file: