shark::ScopedHandle< T > Class Template Reference

#include <shark/Core/utility/ScopedHandle.h>

+ Inheritance diagram for shark::ScopedHandle< T >:

Public Types

typedef boost::function< void(const T &) > DeleterType
 The typedef of deleter for type a T. More...
 
typedef boost::function< bool(const T &) > VerifierType
 Type of verifier which should return true for valid handle, and false otherwise. More...
 

Public Member Functions

 ScopedHandle (const T &handle, const DeleterType &deleter, const std::string &handleDescription="")
 
 ~ScopedHandle ()
 
const T & operator* () const
 The only way to access handle externally. More...
 

Detailed Description

template<typename T>
class shark::ScopedHandle< T >

A handle container which usually taking C style handle such as file Id

Template Parameters
TThe type of handle the container holds

Definition at line 57 of file ScopedHandle.h.

Member Typedef Documentation

◆ DeleterType

template<typename T >
typedef boost::function<void (const T&) > shark::ScopedHandle< T >::DeleterType

The typedef of deleter for type a T.

Definition at line 62 of file ScopedHandle.h.

◆ VerifierType

template<typename T >
typedef boost::function<bool (const T&) > shark::ScopedHandle< T >::VerifierType

Type of verifier which should return true for valid handle, and false otherwise.

Definition at line 65 of file ScopedHandle.h.

Constructor & Destructor Documentation

◆ ScopedHandle()

template<typename T >
shark::ScopedHandle< T >::ScopedHandle ( const T &  handle,
const DeleterType deleter,
const std::string &  handleDescription = "" 
)
inline

Constructor

Parameters
handleThe handle container will hold
deleterThe deleter used for freeing a handle which should return true for valid handles, false otherwise
handleDescriptionA description of handle for easy debugging in case of validation failure

Definition at line 74 of file ScopedHandle.h.

References SHARKEXCEPTION.

◆ ~ScopedHandle()

template<typename T >
shark::ScopedHandle< T >::~ScopedHandle ( )
inline

Definition at line 88 of file ScopedHandle.h.

Member Function Documentation

◆ operator*()

template<typename T >
const T& shark::ScopedHandle< T >::operator* ( ) const
inline

The only way to access handle externally.

Definition at line 95 of file ScopedHandle.h.


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