foobar2000 SDK  2015-08-03
Public Member Functions | Private Types | Private Attributes
static_api_ptr_t< t_interface >

#include <service.h>

Public Member Functions

 static_api_ptr_t ()
 
 static_api_ptr_t (const t_self &in)
 
 ~static_api_ptr_t ()
 
t_interface * get_ptr () const
 
service_obscure_refcounting< t_interface > * operator-> () const
 
const t_selfoperator= (const t_self &in)
 

Private Types

typedef static_api_ptr_t< t_interface > t_self
 

Private Attributes

t_interface * m_ptr
 

Detailed Description

template<typename t_interface>
class static_api_ptr_t< t_interface >

Helper template used to easily access core services.
Usage: static_api_ptr_t<myclass> api; api->dosomething(); Can be used at any point of code, WITH EXCEPTION of static objects that are initialized during the DLL loading process before the service system is initialized; such as static static_api_ptr_t objects or having static_api_ptr_t instances as members of statically created objects. Throws exception_service_not_found if service could not be reached (which can be ignored for core APIs that are always present unless there is some kind of bug in the code).

Definition at line 533 of file service.h.

Member Typedef Documentation

template<typename t_interface>
typedef static_api_ptr_t<t_interface> static_api_ptr_t< t_interface >::t_self
private

Definition at line 535 of file service.h.

Constructor & Destructor Documentation

template<typename t_interface>
static_api_ptr_t< t_interface >::static_api_ptr_t ( )
inline

Definition at line 537 of file service.h.

537  {
539  }
void standard_api_create_t(service_ptr_t< T > &p_out)
Definition: service.h:492
t_interface * m_ptr
Definition: service.h:549
template<typename t_interface>
static_api_ptr_t< t_interface >::~static_api_ptr_t ( )
inline

Definition at line 542 of file service.h.

542 {m_ptr->service_release();}
t_interface * m_ptr
Definition: service.h:549
template<typename t_interface>
static_api_ptr_t< t_interface >::static_api_ptr_t ( const t_self in)
inline

Definition at line 544 of file service.h.

544  {
545  m_ptr = in.m_ptr; m_ptr->service_add_ref();
546  }
t_interface * m_ptr
Definition: service.h:549

Member Function Documentation

template<typename t_interface>
t_interface* static_api_ptr_t< t_interface >::get_ptr ( ) const
inline

Definition at line 541 of file service.h.

541 {return m_ptr;}
t_interface * m_ptr
Definition: service.h:549
template<typename t_interface>
service_obscure_refcounting<t_interface>* static_api_ptr_t< t_interface >::operator-> ( ) const
inline

Definition at line 540 of file service.h.

static service_obscure_refcounting< T > * service_obscure_refcounting_cast(T *p_source)
Converts a service interface pointer to a pointer that obscures service counter functionality.
Definition: service.h:28
t_interface * m_ptr
Definition: service.h:549
template<typename t_interface>
const t_self& static_api_ptr_t< t_interface >::operator= ( const t_self in)
inline

Definition at line 547 of file service.h.

547 {return *this;} //obsolete, each instance should carry the same pointer

Field Documentation

template<typename t_interface>
t_interface* static_api_ptr_t< t_interface >::m_ptr
private

Definition at line 549 of file service.h.


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