UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Private Attributes | List of all members
SafeXRes< T > Class Template Reference

This template provides a container which automatically release a given Xerces resource, when the pointer runs out of scope. More...

#include <xercesc_helpers.h>

Public Member Functions

 SafeXRes (T *ptr)
 Generates a new SafeXRes with the specified resource pointer as content. More...
 
virtual ~SafeXRes ()
 Destroys this SafeXRes object. More...
 
T * getContent ()
 Returns the content stored in this SafeXRes object. More...
 
T * operator-> ()
 Returns the pointer stored in this SafeXRes object. More...
 

Private Attributes

T * resPtr
 This pointer represent a releasable Xerces resource.
 

Detailed Description

template<class T>
class uncover::io::SafeXRes< T >

This template provides a container which automatically release a given Xerces resource, when the pointer runs out of scope.

Author
Jan Stückrath

Constructor & Destructor Documentation

SafeXRes ( T *  ptr)
inline

Generates a new SafeXRes with the specified resource pointer as content.

Parameters
ptra resource pointer which will be safely stored
virtual ~SafeXRes ( )
inlinevirtual

Destroys this SafeXRes object.

The contained resource is thereby properly released.

Member Function Documentation

T* getContent ( )
inline

Returns the content stored in this SafeXRes object.

Note that the returned pointer may not be released, since it will be released automatically when this object is destroyed.

Returns
the content stored in this SafeXRes object
T* operator-> ( )
inline

Returns the pointer stored in this SafeXRes object.

In this way SafeXRes can be used as if it would be a pointer.

Returns
the pointer stored in this SafeXRes object

The documentation for this class was generated from the following file: