Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Teuchos::OpaqueWrapperWithFree< Opaque, OpaqueFree > Class Template Reference

Subclass for wrapped opaque objects with a free function. More...

#include <Teuchos_OpaqueWrapper.hpp>

Inheritance diagram for Teuchos::OpaqueWrapperWithFree< Opaque, OpaqueFree >:
Teuchos::OpaqueWrapper< Opaque >

Public Member Functions

 OpaqueWrapperWithFree (Opaque opaque, OpaqueFree opaqueFree)
 Constructor: takes the opaque handle, and its free function. More...
 
 ~OpaqueWrapperWithFree ()
 Destructor: invokes the free function. More...
 
- Public Member Functions inherited from Teuchos::OpaqueWrapper< Opaque >
 OpaqueWrapper (Opaque opaque)
 Constructor that accepts and wraps a raw handle. More...
 
 operator Opaque () const
 Implicit type conversion from wrapper to raw handle. More...
 
Opaque operator() () const
 Explicit type conversion from wrapper to raw handle. More...
 

Additional Inherited Members

- Protected Attributes inherited from Teuchos::OpaqueWrapper< Opaque >
Opaque opaque_
 The actual handle. More...
 

Detailed Description

template<class Opaque, class OpaqueFree>
class Teuchos::OpaqueWrapperWithFree< Opaque, OpaqueFree >

Subclass for wrapped opaque objects with a free function.

Template Parameters
OpaqueType of the opaque object (a.k.a. handle).
OpaqueFreeType of the function for freeing the handle.
Note
Teuchos users do not normally need to use or refer to this class. The opaqueWrapper() nonmember template function suffices for nearly all use cases. Please see the documentation of the base class OpaqueWrapper.

This subclass allows a client to easily wrap any opaque object that needs a function to free it. This function (or function object) must be callable as:

opaqueFree(&opaque);

It must also be copy constructible. (A function pointer is trivially copy constructible.) Please refer to the documentation of OpaqueWrapper for examples of how to supply a function for freeing an opaque handle.

Definition at line 312 of file Teuchos_OpaqueWrapper.hpp.

Constructor & Destructor Documentation

template<class Opaque , class OpaqueFree >
Teuchos::OpaqueWrapperWithFree< Opaque, OpaqueFree >::OpaqueWrapperWithFree ( Opaque  opaque,
OpaqueFree  opaqueFree 
)
inline

Constructor: takes the opaque handle, and its free function.

Definition at line 315 of file Teuchos_OpaqueWrapper.hpp.

template<class Opaque , class OpaqueFree >
Teuchos::OpaqueWrapperWithFree< Opaque, OpaqueFree >::~OpaqueWrapperWithFree ( )
inline

Destructor: invokes the free function.

Definition at line 319 of file Teuchos_OpaqueWrapper.hpp.


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