gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
Gambit::omp_safe_ptr< TYPE > Class Template Reference

A safe pointer designed to point at an array, and return the entry in that array corresponding to the current OpenMP thread. More...

#include <util_types.hpp>

Inheritance diagram for Gambit::omp_safe_ptr< TYPE >:
Collaboration diagram for Gambit::omp_safe_ptr< TYPE >:

Public Member Functions

 omp_safe_ptr (TYPE *in_ptr=NULL)
 Constructor. More...
 
virtual const TYPE & operator* () const
 Dereference pointer. More...
 
- Public Member Functions inherited from Gambit::safe_ptr< TYPE >
 safe_ptr (TYPE *in_ptr=NULL)
 Construct-o-safe_ptr. More...
 
virtual void set (TYPE *in_ptr)
 Set pointer. More...
 
virtual const TYPE & operator[] (int index) const
 Dereference pointer as if it is an array. More...
 
virtual const TYPE * operator-> () const
 Access is allowed to const member functions only. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from Gambit::safe_ptr< TYPE >
static void dieGracefully ()
 Failure message invoked when the user tries to dereference a null safe_ptr. More...
 
- Protected Attributes inherited from Gambit::safe_ptr< TYPE >
const TYPE * ptr
 The actual underlying pointer, interpreted as a pointer to constant value. More...
 

Detailed Description

template<typename TYPE>
class Gambit::omp_safe_ptr< TYPE >

A safe pointer designed to point at an array, and return the entry in that array corresponding to the current OpenMP thread.

Definition at line 230 of file util_types.hpp.

Constructor & Destructor Documentation

◆ omp_safe_ptr()

template<typename TYPE>
Gambit::omp_safe_ptr< TYPE >::omp_safe_ptr ( TYPE *  in_ptr = NULL)
inline

Constructor.

Definition at line 236 of file util_types.hpp.

236 : safe_ptr<TYPE>(in_ptr) {}

Member Function Documentation

◆ operator*()

template<typename TYPE>
virtual const TYPE& Gambit::omp_safe_ptr< TYPE >::operator* ( ) const
inlinevirtual

Dereference pointer.

Reimplemented from Gambit::safe_ptr< TYPE >.

Definition at line 239 of file util_types.hpp.

References Gambit::safe_ptr< TYPE >::dieGracefully().

240  {
241  if (this->ptr == NULL) safe_ptr<TYPE>::dieGracefully();
242  return *(this->ptr+omp_get_thread_num());
243  }
static void dieGracefully()
Failure message invoked when the user tries to dereference a null safe_ptr.
Definition: util_types.hpp:213
const TYPE * ptr
The actual underlying pointer, interpreted as a pointer to constant value.
Definition: util_types.hpp:210
Here is the call graph for this function:

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