ctkConfigurationAdminActivator_p.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKCONFIGURATIONADMINACTIVATOR_P_H
  16. #define CTKCONFIGURATIONADMINACTIVATOR_P_H
  17. #include <ctkPluginActivator.h>
  18. #include "ctkCMLogTracker_p.h"
  19. class ctkConfigurationAdminFactory;
  20. class ctkConfigurationEventAdapter;
  21. /**
  22. * The ctkConfigurationAdminActivator starts the ctkConfigurationAdminFactory but also handles passing in the Service
  23. * Registration needed by Asynch threads. Asynch threads are controlled by the ctkConfigurationAdminFactory
  24. * start and stop. It requires some care to handle pending events as the service is registered before
  25. * activating the threads. (see ctkConfigurationAdminEventDispatcher)
  26. */
  27. class ctkConfigurationAdminActivator :
  28. public QObject, public ctkPluginActivator
  29. {
  30. Q_OBJECT
  31. Q_INTERFACES(ctkPluginActivator)
  32. #ifdef HAVE_QT5
  33. Q_PLUGIN_METADATA(IID "org_commontk_configadmin")
  34. #endif
  35. public:
  36. ctkConfigurationAdminActivator();
  37. ~ctkConfigurationAdminActivator();
  38. void start(ctkPluginContext* context);
  39. void stop(ctkPluginContext* context);
  40. private:
  41. QFile logFileFallback;
  42. ctkCMLogTracker* logTracker;
  43. ctkServiceRegistration registration;
  44. ctkConfigurationAdminFactory* factory;
  45. ctkConfigurationEventAdapter* eventAdapter;
  46. }; // ctkConfigurationAdminActivator
  47. #endif // CTKCONFIGURATIONADMINACTIVATOR_P_H