foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions
service_baseabstract

#include <service.h>

+ Inheritance diagram for service_base:

Public Types

typedef service_base t_interface
 

Public Member Functions

template<typename outPtr_t >
bool cast (outPtr_t &outPtr)
 
virtual int service_add_ref ()=0 throw ()
 
virtual bool service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid)
 
template<class T >
bool service_query_t (service_ptr_t< T > &p_out)
 
virtual int service_release ()=0 throw ()
 

Protected Member Functions

 service_base ()
 
 ~service_base ()
 

Private Member Functions

 service_base (const service_base &)
 
const service_baseoperator= (const service_base &)
 

Detailed Description

Base class for all service classes.
Provides interfaces for reference counter and querying for different interfaces supported by the object.
.

Definition at line 333 of file service.h.

Member Typedef Documentation

Definition at line 359 of file service.h.

Constructor & Destructor Documentation

service_base::service_base ( )
inlineprotected

Definition at line 362 of file service.h.

362 {}
service_base::~service_base ( )
inlineprotected

Definition at line 363 of file service.h.

363 {}
service_base::service_base ( const service_base )
inlineprivate

Definition at line 365 of file service.h.

365 {throw pfc::exception_not_implemented();}

Member Function Documentation

template<typename outPtr_t >
bool service_base::cast ( outPtr_t &  outPtr)
inline

New shortened version, same as service_query_t.

Definition at line 357 of file service.h.

357 { return service_query_t( outPtr ); }
bool service_query_t(service_ptr_t< T > &p_out)
Queries whether the object supports specific interface and retrieves a pointer to that interface...
Definition: service.h:350
const service_base& service_base::operator= ( const service_base )
inlineprivate

Definition at line 366 of file service.h.

366 {throw pfc::exception_not_implemented();}
virtual int service_base::service_add_ref ( )
throw (
)
pure virtual

Increments reference count. This is normally not called directly but managed by service_ptr_t<> template.

Returns
New reference count. For debug purposes only, in certain conditions return values may be unreliable.

Implemented in service_impl_single_t< contextmenu_group_impl >, service_impl_single_t< input_entry_impl_t< input_wrapper_singletrack_t< T >, t_flags, t_decoder, t_inforeader, t_infowriter > >, service_impl_single_t< advconfig_entry_string_impl_MT >, service_impl_single_t< contextmenu_group_popup_impl >, service_impl_single_t< dsp_entry_impl_nopreset_t< T > >, service_impl_single_t< advconfig_entry_integer_impl >, service_impl_single_t< advconfig_branch_impl >, service_impl_single_t< input_entry_impl_t< T, t_flags, t_decoder, t_inforeader, t_infowriter > >, service_impl_single_t< output_entry_impl_t< T > >, service_impl_single_t< advconfig_entry_checkbox_impl< p_is_radio, prefFlags > >, service_impl_single_t< advconfig_entry_string_impl >, service_impl_single_t< cue_parser::chapterizer_impl_t< t_input_impl > >, service_impl_single_t< input_entry_impl_t< input_wrapper_singletrack_t< T >, 0 > >, service_impl_single_t< input_entry_impl_t< cue_parser::input_wrapper_cue_t< t_input_impl >, t_flags, input_decoder_v2, input_info_reader, input_info_writer > >, service_impl_single_t< input_entry_impl_t< T, 0 > >, service_impl_single_t< input_file_type >, service_impl_single_t< resampler_entry_impl_t< T > >, service_impl_single_t< packet_decoder_entry_impl_t< T > >, service_impl_single_t< input_file_type_impl >, and service_impl_single_t< dsp_entry_v2_impl_t< T > >.

virtual bool service_base::service_query ( service_ptr_t< service_base > &  p_out,
const GUID p_guid 
)
inlinevirtual

Queries whether the object supports specific interface and retrieves a pointer to that interface. This is normally not called directly but managed by service_query_t<> function template. Typical implementation checks the parameter against GUIDs of interfaces supported by this object, if the GUID is one of supported interfaces, p_out is set to service_base pointer that can be static_cast<>'ed to queried interface and the method returns true; otherwise the method returns false.

Definition at line 344 of file service.h.

344 {return false;}
template<class T >
bool service_base::service_query_t ( service_ptr_t< T > &  p_out)
inline

Queries whether the object supports specific interface and retrieves a pointer to that interface.

Parameters
p_outReceives pointer to queried interface on success. returns true on success, false on failure (interface not supported by the object).

Definition at line 350 of file service.h.

351  {
353  return service_query( *reinterpret_cast<service_ptr_t<service_base>*>(&p_out),T::class_guid);
354  }
virtual bool service_query(service_ptr_t< service_base > &p_out, const GUID &p_guid)
Queries whether the object supports specific interface and retrieves a pointer to that interface...
Definition: service.h:344
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
virtual int service_base::service_release ( )
throw (
)
pure virtual

Decrements reference count; deletes the object if reference count reaches zero. This is normally not called directly but managed by service_ptr_t<> template.

Returns
New reference count. For debug purposes only, in certain conditions return values may be unreliable.

Implemented in service_impl_single_t< contextmenu_group_impl >, service_impl_single_t< input_entry_impl_t< input_wrapper_singletrack_t< T >, t_flags, t_decoder, t_inforeader, t_infowriter > >, service_impl_single_t< advconfig_entry_string_impl_MT >, service_impl_single_t< contextmenu_group_popup_impl >, service_impl_single_t< dsp_entry_impl_nopreset_t< T > >, service_impl_single_t< advconfig_entry_integer_impl >, service_impl_single_t< advconfig_branch_impl >, service_impl_single_t< input_entry_impl_t< T, t_flags, t_decoder, t_inforeader, t_infowriter > >, service_impl_single_t< output_entry_impl_t< T > >, service_impl_single_t< advconfig_entry_checkbox_impl< p_is_radio, prefFlags > >, service_impl_single_t< advconfig_entry_string_impl >, service_impl_single_t< cue_parser::chapterizer_impl_t< t_input_impl > >, service_impl_single_t< input_entry_impl_t< input_wrapper_singletrack_t< T >, 0 > >, service_impl_single_t< input_entry_impl_t< cue_parser::input_wrapper_cue_t< t_input_impl >, t_flags, input_decoder_v2, input_info_reader, input_info_writer > >, service_impl_single_t< input_entry_impl_t< T, 0 > >, service_impl_single_t< input_file_type >, service_impl_single_t< resampler_entry_impl_t< T > >, service_impl_single_t< packet_decoder_entry_impl_t< T > >, service_impl_single_t< input_file_type_impl >, and service_impl_single_t< dsp_entry_v2_impl_t< T > >.


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