ctkEventBusPlugin.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. /*
  16. * ctkEventBusPlugin.cxx
  17. *
  18. * Created on: Mar 29, 2010
  19. * Author: zelzer
  20. */
  21. #include "ctkEventBusPlugin_p.h"
  22. #include <QtPlugin>
  23. #include <QServiceInterfaceDescriptor>
  24. #include "ctkEventBusImpl_p.h"
  25. #include <iostream>
  26. using namespace QtMobility;
  27. void ctkEventBusPlugin::start(ctkPluginContext* context)
  28. {
  29. Q_UNUSED(context)
  30. std::cout << "org.commontk.eventbus Plugin started\n";
  31. }
  32. void ctkEventBusPlugin::stop(ctkPluginContext* context)
  33. {
  34. Q_UNUSED(context)
  35. std::cout << "org.commontk.eventbus Plugin stopped\n";
  36. }
  37. QObject* ctkEventBusPlugin::createInstance(const QServiceInterfaceDescriptor& descriptor,
  38. QServiceContext* context,
  39. QAbstractSecuritySession* session)
  40. {
  41. Q_UNUSED(context)
  42. Q_UNUSED(session)
  43. std::cout << "Creating service instance for " << descriptor.interfaceName().toStdString() << std::endl;
  44. if (descriptor.interfaceName() == "org.commontk.core.EventBus")
  45. {
  46. return ctkEventBusImpl::instance();
  47. }
  48. return 0;
  49. }
  50. Q_EXPORT_PLUGIN2(org_commontk_eventbus, ctkEventBusPlugin)