Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | 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 >:
Inheritance graph
[legend]

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...
 

Private Member Functions

 OpaqueWrapperWithFree ()
 
 OpaqueWrapperWithFree (const OpaqueWrapperWithFree &)
 
OpaqueWrapperWithFreeoperator= (const OpaqueWrapperWithFree &)
 

Private Attributes

OpaqueFree opaqueFree_
 Function (or function object) for freeing the 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 280 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 283 of file Teuchos_OpaqueWrapper.hpp.

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

Destructor: invokes the free function.

Definition at line 287 of file Teuchos_OpaqueWrapper.hpp.

template<class Opaque , class OpaqueFree >
Teuchos::OpaqueWrapperWithFree< Opaque, OpaqueFree >::OpaqueWrapperWithFree ( )
private
template<class Opaque , class OpaqueFree >
Teuchos::OpaqueWrapperWithFree< Opaque, OpaqueFree >::OpaqueWrapperWithFree ( const OpaqueWrapperWithFree< Opaque, OpaqueFree > &  )
private

Member Function Documentation

template<class Opaque , class OpaqueFree >
OpaqueWrapperWithFree& Teuchos::OpaqueWrapperWithFree< Opaque, OpaqueFree >::operator= ( const OpaqueWrapperWithFree< Opaque, OpaqueFree > &  )
private

Member Data Documentation

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

Function (or function object) for freeing the handle.

Definition at line 305 of file Teuchos_OpaqueWrapper.hpp.


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