1
0

ExComponent.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. #include "ExComponent.h"
  2. #include "api/service/api_service.h" // Service Manager is central to Wasabi
  3. #include "SimpleHandlerFactory.h" // the Service Factory we're going to regsister
  4. // the service factory we're going to register
  5. static SimpleHandlerFactory simpleHandlerFactory;
  6. void ExComponent::RegisterServices(api_service *service)
  7. {
  8. // If we need any services, we can retrieve them here
  9. // however, you have no guarantee that a service you want will be active yet
  10. // so it's best to "lazy load" and get it the first time you need it
  11. // Register any services we provide here
  12. service->service_register(&simpleHandlerFactory);
  13. }
  14. void ExComponent::DeregisterServices(api_service *service)
  15. {
  16. // Unregister our services
  17. service->service_deregister(&simpleHandlerFactory);
  18. // And release any services we retrieved
  19. }
  20. // Define the dispatch table
  21. #define CBCLASS ExComponent
  22. START_DISPATCH;
  23. VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices)
  24. VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices)
  25. END_DISPATCH;
  26. #undef CBCLASS