21 explicit componentversion_impl_simple(
const char * p_name,
const char * p_version,
const char * p_about) : name(p_name), version(p_version), about(p_about ? p_about :
"") {}
33 explicit componentversion_impl_copy(
const char * p_name,
const char * p_version,
const char * p_about) : name(p_name), version(p_version), about(p_about ? p_about :
"") {}
55 #define DECLARE_COMPONENT_VERSION(NAME,VERSION,ABOUT) \ 56 namespace {class componentversion_myimpl : public componentversion { public: componentversion_myimpl() {PFC_ASSERT( ABOUT );} \ 57 void get_file_name(pfc::string_base & out) {out = core_api::get_my_file_name();} \ 58 void get_component_name(pfc::string_base & out) {out = NAME;} \ 59 void get_component_version(pfc::string_base & out) {out = VERSION;} \ 60 void get_about_message(pfc::string_base & out) {out = ABOUT;} \ 61 }; static service_factory_single_t<componentversion_myimpl> g_componentversion_myimpl_factory; } 65 #define DECLARE_COMPONENT_VERSION_COPY(NAME,VERSION,ABOUT) \ 66 static componentversion_impl_copy_factory g_componentversion_service(NAME,VERSION,ABOUT); 73 virtual bool is_installed_correctly() = 0;
75 static bool test_my_name(
const char * fn);
76 static bool have_other_file(
const char * fn);
86 return test_my_name(m_dllName);
92 #define VALIDATE_COMPONENT_FILENAME(FN) \ 93 static service_factory_single_t<component_installation_validator_filename> g_component_installation_validator_filename(FN);
virtual void get_file_name(pfc::string_base &out)
componentversion_impl_simple_factory(const char *p_name, const char *p_version, const char *p_about)
virtual void get_component_version(pfc::string_base &out)
component_installation_validator_filename(const char *dllName)
Implementation helper. You typically want to use DECLARE_COMPONENT_VERSION() instead.
componentversion_impl_copy(const char *p_name, const char *p_version, const char *p_about)
virtual void get_about_message(pfc::string_base &out)
service_factory_single_transparent_t< componentversion_impl_copy > __componentversion_impl_copy_factory
componentversion_impl_simple(const char *p_name, const char *p_version, const char *p_about)
Entrypoint interface for declaring component's version information. Instead of implementing this dire...
service_factory_single_transparent_t< componentversion_impl_simple > __componentversion_impl_simple_factory
virtual void get_component_name(pfc::string_base &out)
const char * get_my_file_name()
Retrieves filename of calling dll, excluding extension, e.g. "foo_asdf".
Implementation helper. You typically want to use DECLARE_COMPONENT_VERSION() instead.
Simple implementation of component_installation_validator that makes sure that our component DLL has ...
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
virtual void get_component_version(pfc::string_base &out)
virtual void set_string(const char *p_string, t_size p_length=~0)
const char *const m_dllName
virtual void get_about_message(pfc::string_base &out)
bool is_installed_correctly()
virtual void get_file_name(pfc::string_base &out)
componentversion_impl_copy_factory(const char *p_name, const char *p_version, const char *p_about)
virtual void get_component_name(pfc::string_base &out)