#include "service_impl.h"Go to the source code of this file.
Namespaces | |
| namespace | pfc |
Classes | |
| class | service_obscure_refcounting< T > |
| Special hack to ensure errors when someone tries to ->service_add_ref()/->service_release() on a service_ptr_t. More... | |
| class | service_ptr_t< T > |
| Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes. More... | |
| class | pfc::pfc::traits_t< service_ptr_t< T > > |
| class | service_list_t< T, t_alloc > |
| class | service_base |
| class | service_factory_base |
| class | service_factory_base_t< B > |
| class | service_class_helper_t< T > |
| class | static_api_ptr_t< t_interface > |
| class | service_instance_array_t< T > |
| Helper; simulates array with instance of each available implementation of given service class. More... | |
| class | service_enum_t< t_interface > |
| class | service_factory_t< T > |
| class | service_factory_single_t< T > |
| class | service_factory_single_ref_t< T > |
| class | service_factory_single_transparent_t< T > |
Defines | |
| #define | FOOGUIDDECL |
| #define | DECLARE_GUID(NAME, A, S, D, F, G, H, J, K, L, Z, X) FOOGUIDDECL const GUID NAME = {A,S,D,{F,G,H,J,K,L,Z,X}}; |
| #define | DECLARE_CLASS_GUID(NAME, A, S, D, F, G, H, J, K, L, Z, X) FOOGUIDDECL const GUID NAME::class_guid = {A,S,D,{F,G,H,J,K,L,Z,X}}; |
| #define | FB2K_MAKE_SERVICE_INTERFACE(THISCLASS, PARENTCLASS) |
| #define | FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(THISCLASS) |
| #define | FB2K_DECLARE_SERVICE_BEGIN(THISCLASS, BASECLASS) |
| #define | FB2K_DECLARE_SERVICE_END() }; |
| #define | FB2K_DECLARE_SERVICE_ENTRYPOINT_BEGIN(THISCLASS) |
Typedefs | |
| typedef const void * | service_class_ref |
Functions | |
| PFC_DECLARE_EXCEPTION (exception_service_not_found, pfc::exception,"Service not found") | |
| PFC_DECLARE_EXCEPTION (exception_service_extension_not_found, pfc::exception,"Service extension not found") | |
| PFC_DECLARE_EXCEPTION (exception_service_duplicated, pfc::exception,"Service duplicated") | |
| template<typename T> | |
| static service_obscure_refcounting< T > * | service_obscure_refcounting_cast (T *p_source) throw () |
| Converts a service interface pointer to a pointer that obscures service counter functionality. | |
| template<typename T> | |
| static void | service_release_safe (T *p_ptr) throw () |
| Multiple inheritance SNAFU fix. In some cases, old service_release_safe method of service_base would not get a NULL this pointer when called on a NULL pointer. | |
| template<typename T> | |
| static void | service_add_ref_safe (T *p_ptr) throw () |
| Multiple inheritance SNAFU fix. In some cases, old service_add_ref_safe method of service_base would not get a NULL this pointer when called on a NULL pointer. | |
| template<typename T> | |
| static void | __validate_service_class_helper () |
| template<> | |
| static void | __validate_service_class_helper< service_base > () |
| template<class T> | |
| static bool | service_enum_create_t (service_ptr_t< T > &p_out, t_size p_index) |
| template<typename T> | |
| static void | standard_api_create_t (service_ptr_t< T > &p_out) |
| template<typename T> | |
| static service_ptr_t< T > | standard_api_create_t () |
| #define DECLARE_CLASS_GUID | ( | NAME, | |||
| A, | |||||
| S, | |||||
| D, | |||||
| F, | |||||
| G, | |||||
| H, | |||||
| J, | |||||
| K, | |||||
| L, | |||||
| Z, | |||||
| X | ) | FOOGUIDDECL const GUID NAME::class_guid = {A,S,D,{F,G,H,J,K,L,Z,X}}; |
| #define DECLARE_GUID | ( | NAME, | |||
| A, | |||||
| S, | |||||
| D, | |||||
| F, | |||||
| G, | |||||
| H, | |||||
| J, | |||||
| K, | |||||
| L, | |||||
| Z, | |||||
| X | ) | FOOGUIDDECL const GUID NAME = {A,S,D,{F,G,H,J,K,L,Z,X}}; |
| #define FB2K_DECLARE_SERVICE_BEGIN | ( | THISCLASS, | |||
| BASECLASS | ) |
Value:
class NOVTABLE THISCLASS : public BASECLASS { \ FB2K_MAKE_SERVICE_INTERFACE(THISCLASS,BASECLASS); \ public:
| #define FB2K_DECLARE_SERVICE_END | ( | ) | }; |
| #define FB2K_DECLARE_SERVICE_ENTRYPOINT_BEGIN | ( | THISCLASS | ) |
Value:
class NOVTABLE THISCLASS : public service_base { \ FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(THISCLASS) \ public:
| #define FB2K_MAKE_SERVICE_INTERFACE | ( | THISCLASS, | |||
| PARENTCLASS | ) |
Value:
public: \ typedef THISCLASS t_interface; \ typedef PARENTCLASS t_interface_parent; \ \ static const GUID class_guid; \ \ virtual bool service_query(service_ptr_t<service_base> & p_out,const GUID & p_guid) { \ if (p_guid == class_guid) {p_out = this; return true;} \ else return PARENTCLASS::service_query(p_out,p_guid); \ } \ protected: \ THISCLASS() {} \ ~THISCLASS() {} \ private: \ const THISCLASS & operator=(const THISCLASS &) {throw pfc::exception_not_implemented();} \ THISCLASS(const THISCLASS &) {throw pfc::exception_not_implemented();} \ private: \ void __private__service_declaration_selftest() { \ pfc::assert_same_type<PARENTCLASS,PARENTCLASS::t_interface>(); /*parentclass must be an interface*/ \ __validate_service_class_helper<THISCLASS>(); /*service_base must be reachable by walking t_interface_parent*/ \ pfc::safe_cast<service_base*>(this); /*this class must derive from service_base, directly or indirectly, and be implictly castable to it*/ \ }
| #define FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT | ( | THISCLASS | ) |
Value:
public: \ typedef THISCLASS t_interface_entrypoint; \ FB2K_MAKE_SERVICE_INTERFACE(THISCLASS,service_base)
| #define FOOGUIDDECL |
| typedef const void* service_class_ref |
| static void __validate_service_class_helper | ( | ) | [inline, static] |
| static void __validate_service_class_helper< service_base > | ( | ) | [inline, static] |
| PFC_DECLARE_EXCEPTION | ( | exception_service_duplicated | , | |
| pfc::exception | , | |||
| "Service duplicated" | ||||
| ) |
| PFC_DECLARE_EXCEPTION | ( | exception_service_extension_not_found | , | |
| pfc::exception | , | |||
| "Service extension not found" | ||||
| ) |
| PFC_DECLARE_EXCEPTION | ( | exception_service_not_found | , | |
| pfc::exception | , | |||
| "Service not found" | ||||
| ) |
| static void service_add_ref_safe | ( | T * | p_ptr | ) | throw () [inline, static] |
Multiple inheritance SNAFU fix. In some cases, old service_add_ref_safe method of service_base would not get a NULL this pointer when called on a NULL pointer.
| static bool service_enum_create_t | ( | service_ptr_t< T > & | p_out, | |
| t_size | p_index | |||
| ) | [inline, static] |
| static service_obscure_refcounting<T>* service_obscure_refcounting_cast | ( | T * | p_source | ) | throw () [inline, static] |
Converts a service interface pointer to a pointer that obscures service counter functionality.
| static void service_release_safe | ( | T * | p_ptr | ) | throw () [inline, static] |
Multiple inheritance SNAFU fix. In some cases, old service_release_safe method of service_base would not get a NULL this pointer when called on a NULL pointer.
| static service_ptr_t<T> standard_api_create_t | ( | ) | [inline, static] |
| static void standard_api_create_t | ( | service_ptr_t< T > & | p_out | ) | [inline, static] |
1.5.5