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

An interface class for backend variables. More...

#include <safety_bucket.hpp>

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

Public Member Functions

 BEvariable_bucket (str mym, str myf, str me, backend_functor< TYPE *(*)(), TYPE *> *functor_ptr_in=NULL)
 Constructor for BEvariable_bucket. More...
 
void initialize (backend_functor< TYPE *(*)(), TYPE *> *functor_ptr_in)
 Initialize this bucket with a functor pointer. More...
 
TYPE & operator* ()
 Dereference the variable pointer stored as a safe_variable_ptr. More...
 
TYPE * operator-> ()
 Access member functions. More...
 
TYPE * pointer ()
 Get the underlying variable pointer. More...
 
safe_variable_ptr< TYPE > & safe_pointer ()
 Get the safe_variable_ptr. More...
 
- Public Member Functions inherited from Gambit::BE_bucket_base
 BE_bucket_base (str mym, str myf, str me)
 Constructor for BE_bucket_base. More...
 
str backend ()
 Get backend name. More...
 
str version ()
 Get version information. More...
 
- Public Member Functions inherited from Gambit::safety_bucket_base
 safety_bucket_base (str myinfo)
 Master constructor. More...
 
str name ()
 Get capability name. More...
 
str origin ()
 Get name of origin (module/backend). More...
 

Protected Attributes

backend_functor< TYPE *(*)(), TYPE * > * _functor_ptr
 
safe_variable_ptr< TYPE > _svptr
 
- Protected Attributes inherited from Gambit::safety_bucket_base
functor_functor_base_ptr
 
bool _initialized
 
const str whoami
 

Additional Inherited Members

- Protected Member Functions inherited from Gambit::safety_bucket_base
void dieGracefully () const
 Failure message invoked when the user tries to access the object before it is initialized. More...
 

Detailed Description

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

An interface class for backend variables.

Definition at line 200 of file safety_bucket.hpp.

Constructor & Destructor Documentation

◆ BEvariable_bucket()

template<typename TYPE >
Gambit::BEvariable_bucket< TYPE >::BEvariable_bucket ( str  mym,
str  myf,
str  me,
backend_functor< TYPE *(*)(), TYPE *> *  functor_ptr_in = NULL 
)
inline

Constructor for BEvariable_bucket.

Definition at line 211 of file safety_bucket.hpp.

212  : BE_bucket_base(mym, myf, me)
213  {
214  initialize(functor_ptr_in);
215  }
BE_bucket_base(str mym, str myf, str me)
Constructor for BE_bucket_base.
void initialize(backend_functor< TYPE *(*)(), TYPE *> *functor_ptr_in)
Initialize this bucket with a functor pointer.

Member Function Documentation

◆ initialize()

template<typename TYPE >
void Gambit::BEvariable_bucket< TYPE >::initialize ( backend_functor< TYPE *(*)(), TYPE *> *  functor_ptr_in)
inline

Initialize this bucket with a functor pointer.

Definition at line 219 of file safety_bucket.hpp.

References Gambit::safety_bucket_base::_functor_base_ptr, Gambit::safety_bucket_base::_initialized, and Gambit::safe_variable_ptr< TYPE >::set().

220  {
221  _functor_ptr = functor_ptr_in;
222  _functor_base_ptr = functor_ptr_in;
223 
224  if (functor_ptr_in == NULL)
225  {
226  _svptr.set(NULL);
227  _initialized = false;
228  }
229  else
230  {
231  // Extract variable pointer from functor and store as a safe_variable_ptr
232  _svptr.set( (*_functor_ptr)() );
233  _initialized = true;
234  }
235  }
safe_variable_ptr< TYPE > _svptr
backend_functor< TYPE *(*)(), TYPE * > * _functor_ptr
Here is the call graph for this function:

◆ operator*()

template<typename TYPE >
TYPE& Gambit::BEvariable_bucket< TYPE >::operator* ( )
inline

Dereference the variable pointer stored as a safe_variable_ptr.

Definition at line 238 of file safety_bucket.hpp.

References Gambit::safety_bucket_base::_initialized, and Gambit::safety_bucket_base::dieGracefully().

239  {
240  if (not _initialized) dieGracefully();
241  return *_svptr;
242  }
safe_variable_ptr< TYPE > _svptr
void dieGracefully() const
Failure message invoked when the user tries to access the object before it is initialized.
Here is the call graph for this function:

◆ operator->()

template<typename TYPE >
TYPE* Gambit::BEvariable_bucket< TYPE >::operator-> ( )
inline

Access member functions.

Definition at line 245 of file safety_bucket.hpp.

246  {
247  return _svptr.operator->();
248  }
safe_variable_ptr< TYPE > _svptr

◆ pointer()

template<typename TYPE >
TYPE* Gambit::BEvariable_bucket< TYPE >::pointer ( )
inline

Get the underlying variable pointer.

Definition at line 251 of file safety_bucket.hpp.

References Gambit::safety_bucket_base::_initialized, Gambit::safety_bucket_base::dieGracefully(), and Gambit::safe_variable_ptr< TYPE >::get().

252  {
253  if (not _initialized) dieGracefully();
254  return _svptr.get();
255  }
safe_variable_ptr< TYPE > _svptr
void dieGracefully() const
Failure message invoked when the user tries to access the object before it is initialized.
Here is the call graph for this function:

◆ safe_pointer()

template<typename TYPE >
safe_variable_ptr<TYPE>& Gambit::BEvariable_bucket< TYPE >::safe_pointer ( )
inline

Get the safe_variable_ptr.

Definition at line 258 of file safety_bucket.hpp.

References Gambit::safety_bucket_base::_initialized, convolve_with_theory::ARGS, and Gambit::safety_bucket_base::dieGracefully().

259  {
260  if (not _initialized) dieGracefully();
261  return _svptr;
262  }
safe_variable_ptr< TYPE > _svptr
void dieGracefully() const
Failure message invoked when the user tries to access the object before it is initialized.
Here is the call graph for this function:

Member Data Documentation

◆ _functor_ptr

template<typename TYPE >
backend_functor<TYPE*(*)(),TYPE*>* Gambit::BEvariable_bucket< TYPE >::_functor_ptr
protected

Definition at line 205 of file safety_bucket.hpp.

◆ _svptr

template<typename TYPE >
safe_variable_ptr<TYPE> Gambit::BEvariable_bucket< TYPE >::_svptr
protected

Definition at line 206 of file safety_bucket.hpp.


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