#include "service_wrapper.h" #include "logger_bundle_export.h" #include "logger_activator.h" #include "logger_impl.h" static BundleActivator_logger activator; void* newActivator() { return &activator; } void* newService(const char* name) { if (0 == name) { return 0; } if (std::string("logger") == name) { try { ServiceWrapper* logger = new ServiceWrapper(); return logger->service(); } catch (std::bad_alloc&) { return 0; } } return 0; } void* destroyService(void* service, const char* name) { if (0 == service || 0 == name) { return 0; } if (std::string(name) == "logger") { LoggerImpl* logger = ServiceWrapper::cast(service); if (0 == logger) { return 0; } logger->destroy(); } return 0; }