vSMC
vSMC: Scalable Monte Carlo
Public Member Functions | List of all members
vsmc::DispatchObject< DispatchType > Class Template Reference

Base class of Dispatch objects. More...

#include <vsmc/gcd/dispatch_object.hpp>

Public Member Functions

 DispatchObject (const DispatchType &object, bool retained)
 Create a DispatchObject from its C-type object. More...
 
 DispatchObject (const DispatchObject< DispatchType > &other)
 
 DispatchObject (DispatchObject< DispatchType > &&other)
 
 ~DispatchObject ()
 
void * get_context () const
 
DispatchType object () const
 Return the underlying Dispatch object. More...
 
void object (DispatchType obj)
 Set the underlying Dispatch object and retain it. More...
 
DispatchObject< DispatchType > & operator= (const DispatchObject< DispatchType > &other)
 
DispatchObject< DispatchType > & operator= (DispatchObject< DispatchType > &&other)
 
void set_context (void *context) const
 
void set_finalizer_f (::dispatch_function_t finalizer) const
 

Detailed Description

template<typename DispatchType>
class vsmc::DispatchObject< DispatchType >

Base class of Dispatch objects.

All Dispatch objects are reference counting shared objects

Definition at line 45 of file dispatch_object.hpp.

Constructor & Destructor Documentation

template<typename DispatchType>
vsmc::DispatchObject< DispatchType >::DispatchObject ( const DispatchType &  object,
bool  retained 
)
inline

Create a DispatchObject from its C-type object.

Parameters
objectThe raw object to be aquired
retainedWhether the object is already retained. Some objects are retained at least once when it is created. These objects shall not be retained again by this constructor. Passing true as this argument prevent the constructor to retain the object.

Definition at line 56 of file dispatch_object.hpp.

template<typename DispatchType>
vsmc::DispatchObject< DispatchType >::DispatchObject ( const DispatchObject< DispatchType > &  other)
inline

Definition at line 59 of file dispatch_object.hpp.

template<typename DispatchType>
vsmc::DispatchObject< DispatchType >::DispatchObject ( DispatchObject< DispatchType > &&  other)
inline

Definition at line 75 of file dispatch_object.hpp.

template<typename DispatchType>
vsmc::DispatchObject< DispatchType >::~DispatchObject ( )
inline

Definition at line 90 of file dispatch_object.hpp.

Member Function Documentation

template<typename DispatchType>
void* vsmc::DispatchObject< DispatchType >::get_context ( ) const
inline

Definition at line 105 of file dispatch_object.hpp.

template<typename DispatchType>
DispatchType vsmc::DispatchObject< DispatchType >::object ( ) const
inline

Return the underlying Dispatch object.

Definition at line 93 of file dispatch_object.hpp.

template<typename DispatchType>
void vsmc::DispatchObject< DispatchType >::object ( DispatchType  obj)
inline

Set the underlying Dispatch object and retain it.

Definition at line 96 of file dispatch_object.hpp.

template<typename DispatchType>
DispatchObject<DispatchType>& vsmc::DispatchObject< DispatchType >::operator= ( const DispatchObject< DispatchType > &  other)
inline

Definition at line 62 of file dispatch_object.hpp.

template<typename DispatchType>
DispatchObject<DispatchType>& vsmc::DispatchObject< DispatchType >::operator= ( DispatchObject< DispatchType > &&  other)
inline

Definition at line 78 of file dispatch_object.hpp.

template<typename DispatchType>
void vsmc::DispatchObject< DispatchType >::set_context ( void *  context) const
inline

Definition at line 108 of file dispatch_object.hpp.

template<typename DispatchType>
void vsmc::DispatchObject< DispatchType >::set_finalizer_f ( ::dispatch_function_t  finalizer) const
inline

Definition at line 111 of file dispatch_object.hpp.