foobar2000 SDK  2015-08-03
Public Member Functions
service_impl_t< T >

#include <service_impl.h>

+ Inheritance diagram for service_impl_t< T >:

Public Member Functions

int service_add_ref () throw ()
 
int service_release () throw ()
 

Detailed Description

template<typename T>
class service_impl_t< T >

Template implementing reference-counting features of service_base. Intended for dynamic instantiation: "new service_impl_t<someclass>(param1,param2);"; should not be instantiated otherwise (no local/static/member objects) because it does a "delete this;" when reference count reaches zero.
Note that some constructor parameters such as NULL will need explicit typecasts to ensure correctly guessed types for constructor function template (null string needs to be (const char*)NULL rather than just NULL, etc).

Definition at line 4 of file service_impl.h.

Member Function Documentation

template<typename T>
int service_impl_t< T >::service_add_ref ( )
throw (
)
inline

Definition at line 14 of file service_impl.h.

14 {return (int) ++m_counter;}
template<typename T>
int service_impl_t< T >::service_release ( )
throw (
)
inline

Definition at line 7 of file service_impl.h.

7  {
8  int ret = (int) --m_counter;
9  if (ret == 0) {
10  PFC_ASSERT_NO_EXCEPTION( delete this );
11  }
12  return ret;
13  }

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