foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
CF::CallForwarder< TWhat >

#include <CallForwarder.h>

+ Inheritance diagram for CF::CallForwarder< TWhat >:

Public Member Functions

 CallForwarder (TWhat *ptr)
 
template<typename arg_t >
void callInMainThread (const arg_t &arg)
 
bool IsEmpty () const
 
bool IsValid () const
 
TWhat & operator* () const
 
TWhat * operator-> () const
 
void Orphan ()
 

Private Attributes

pfc::rcptr_t< TWhat * > m_ptr
 

Detailed Description

template<typename TWhat>
class CF::CallForwarder< TWhat >

Definition at line 14 of file CallForwarder.h.

Constructor & Destructor Documentation

template<typename TWhat >
CF::CallForwarder< TWhat >::CallForwarder ( TWhat *  ptr)
inline

Definition at line 16 of file CallForwarder.h.

16 { m_ptr.new_t(ptr); }
void new_t()
Definition: rcptr.h:101
pfc::rcptr_t< TWhat * > m_ptr
Definition: CallForwarder.h:37

Member Function Documentation

template<typename TWhat >
template<typename arg_t >
void CF::CallForwarder< TWhat >::callInMainThread ( const arg_t &  arg)
inline

Definition at line 33 of file CallForwarder.h.

33  {
34  main_thread_callback_add( new service_impl_t<_inMainThread< CallForwarder<TWhat>, arg_t> >(*this, arg) );
35  }
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
void main_thread_callback_add(main_thread_callback::ptr ptr)
template<typename TWhat >
bool CF::CallForwarder< TWhat >::IsEmpty ( ) const
inline

Definition at line 20 of file CallForwarder.h.

20 { return !IsValid(); }
bool IsValid() const
Definition: CallForwarder.h:19
template<typename TWhat >
bool CF::CallForwarder< TWhat >::IsValid ( ) const
inline

Definition at line 19 of file CallForwarder.h.

19 { return *m_ptr != NULL; }
pfc::rcptr_t< TWhat * > m_ptr
Definition: CallForwarder.h:37
template<typename TWhat >
TWhat& CF::CallForwarder< TWhat >::operator* ( ) const
inline

Definition at line 27 of file CallForwarder.h.

27  {
28  PFC_ASSERT( IsValid() );
29  return **m_ptr;
30  }
pfc::rcptr_t< TWhat * > m_ptr
Definition: CallForwarder.h:37
bool IsValid() const
Definition: CallForwarder.h:19
template<typename TWhat >
TWhat* CF::CallForwarder< TWhat >::operator-> ( ) const
inline

Definition at line 22 of file CallForwarder.h.

22  {
23  PFC_ASSERT( IsValid() );
24  return *m_ptr;
25  }
pfc::rcptr_t< TWhat * > m_ptr
Definition: CallForwarder.h:37
bool IsValid() const
Definition: CallForwarder.h:19
template<typename TWhat >
void CF::CallForwarder< TWhat >::Orphan ( )
inline

Definition at line 18 of file CallForwarder.h.

18 {*m_ptr = NULL;}
pfc::rcptr_t< TWhat * > m_ptr
Definition: CallForwarder.h:37

Field Documentation

template<typename TWhat >
pfc::rcptr_t<TWhat*> CF::CallForwarder< TWhat >::m_ptr
private

Definition at line 37 of file CallForwarder.h.


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