foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
service_by_guid_data< what >

#include <service.h>

Public Member Functions

 service_by_guid_data ()
 
bool create (service_ptr_t< what > &out, const GUID &theID) const
 
service_ptr_t< what > create (const GUID &theID) const
 
void initialize ()
 
bool ready () const
 

Private Attributes

volatile bool m_inited
 
pfc::map_t< GUID, t_sizem_order
 
service_class_ref m_servClass
 

Detailed Description

template<typename what>
class service_by_guid_data< what >

Definition at line 687 of file service.h.

Constructor & Destructor Documentation

template<typename what>
service_by_guid_data< what >::service_by_guid_data ( )
inline

Definition at line 689 of file service.h.

689 : m_servClass(), m_inited() {}
service_class_ref m_servClass
Definition: service.h:721
volatile bool m_inited
Definition: service.h:719

Member Function Documentation

template<typename what>
bool service_by_guid_data< what >::create ( service_ptr_t< what > &  out,
const GUID theID 
) const
inline

Definition at line 708 of file service.h.

708  {
709  PFC_ASSERT(m_inited);
710  t_size index;
711  if (!m_order.query(theID,index)) return false;
712  return _service_instantiate_helper(out, m_servClass, index);
713  }
service_class_ref m_servClass
Definition: service.h:721
pfc::map_t< GUID, t_size > m_order
Definition: service.h:720
size_t t_size
Definition: int_types.h:48
volatile bool m_inited
Definition: service.h:719
static bool _service_instantiate_helper(service_ptr_t< what > &out, service_class_ref servClass, t_size index)
Definition: service.h:451
bool query(const _t_key &p_key, _t_value &p_value) const
Definition: map.h:44
template<typename what>
service_ptr_t<what> service_by_guid_data< what >::create ( const GUID theID) const
inline

Definition at line 714 of file service.h.

714  {
715  service_ptr_t<what> temp; if (!crete(temp,theID)) throw exception_service_not_found(); return temp;
716  }
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
template<typename what>
void service_by_guid_data< what >::initialize ( )
inline

Definition at line 694 of file service.h.

694  {
695  if (m_inited) return;
698  const t_size servCount = service_factory_base::enum_get_count(m_servClass);
699  for(t_size walk = 0; walk < servCount; ++walk) {
700  service_ptr_t<what> temp;
701  if (_service_instantiate_helper(temp, m_servClass, walk)) {
702  m_order.set(temp->get_guid(), walk);
703  }
704  }
705  m_inited = true;
706  }
service_class_ref m_servClass
Definition: service.h:721
pfc::map_t< GUID, t_size > m_order
Definition: service.h:720
static t_size enum_get_count(service_class_ref p_class)
Definition: service.cpp:18
size_t t_size
Definition: int_types.h:48
static service_class_ref enum_find_class(const GUID &p_guid)
Definition: service.cpp:6
void set(const _t_key &p_key, const _t_value &p_value)
Definition: map.h:22
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
volatile bool m_inited
Definition: service.h:719
static bool _service_instantiate_helper(service_ptr_t< what > &out, service_class_ref servClass, t_size index)
Definition: service.h:451
template<typename what>
bool service_by_guid_data< what >::ready ( ) const
inline

Definition at line 691 of file service.h.

691 {return m_inited;}
volatile bool m_inited
Definition: service.h:719

Field Documentation

template<typename what>
volatile bool service_by_guid_data< what >::m_inited
private

Definition at line 719 of file service.h.

template<typename what>
pfc::map_t<GUID,t_size> service_by_guid_data< what >::m_order
private

Definition at line 720 of file service.h.

template<typename what>
service_class_ref service_by_guid_data< what >::m_servClass
private

Definition at line 721 of file service.h.


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