Logo Search packages:      
Sourcecode: libical version File versions  Download package

icptrholder.h File Reference

Detailed Description

C++ template classes for managing C++ pointers returned by VComponent::get_..._component, VComponent::get_..._property, ICalPropety::get_..._value.

wyau (08/29/02)
VComponent::get... functions returns a C++ oject that wraps the libical implementation. It is important to note that the wrapped implementation still belongs to the orginal component. To stop memory leak, caller must delete the pointer. However, the destructor will call the appropriate free function. eg. ~VComponent calls icalcomponent_free(imp). As stated previously, imp stil belongs to the original component. To avoid freeing the wrapped "imp", caller must set the "imp" to null before deleting the pointer.
The template class relieves the burden of memory management when used as a stack based object. The class holds a pointer to the C++ Wrapper. The destructor set the imp to null before deleting the pointer.

Each C++ Wrapper instantiates a template class in it's corresponding .h file.

Usage example: VComponentTmpPtr p; // VComponentTmpPtr is an instantiation of this template for (p=component.get_first_component; p!= NULL; p=component.get_next_component) {

(C) COPYRIGHT 2001, Critical Path

This program is free software; you can redistribute it and/or modify it under the terms of either:

The LGPL as published by the Free Software Foundation, version 2.1, available at: http://www.fsf.org/copyleft/lesser.html


The Mozilla Public License Version 1.0. You may obtain a copy of the License at http://www.mozilla.org/MPL/

Definition in file icptrholder.h.

Go to the source code of this file.


class  ICPointerHolder< T >

Generated by  Doxygen 1.6.0   Back to index