ctkCmdLineModuleConcurrentHelpers.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 CTKCMDLINEMODULECONCURRENTHELPERS_H
  16. #define CTKCMDLINEMODULECONCURRENTHELPERS_H
  17. #include "ctkCommandLineModulesCoreExport.h"
  18. #include "ctkCmdLineModuleReference.h"
  19. class ctkCmdLineModuleManager;
  20. /**
  21. * \ingroup CommandLineModulesCore_API
  22. *
  23. * \brief A function object for concurrently adding modules.
  24. */
  25. class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleConcurrentRegister
  26. {
  27. public:
  28. typedef ctkCmdLineModuleReference result_type;
  29. ctkCmdLineModuleConcurrentRegister(ctkCmdLineModuleManager* manager, bool debug = false);
  30. ctkCmdLineModuleReference operator()(const QString& moduleLocation);
  31. ctkCmdLineModuleReference operator()(const QUrl& moduleUrl);
  32. private:
  33. ctkCmdLineModuleManager* ModuleManager;
  34. bool Debug;
  35. };
  36. /**
  37. * \ingroup CommandLineModulesCore_API
  38. *
  39. * \brief A function object for concurrently removing modules.
  40. */
  41. class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleConcurrentUnRegister
  42. {
  43. public:
  44. typedef bool result_type;
  45. ctkCmdLineModuleConcurrentUnRegister(ctkCmdLineModuleManager* manager);
  46. bool operator()(const QString& moduleLocation);
  47. bool operator()(const QUrl& moduleUrl);
  48. bool operator()(const ctkCmdLineModuleReference& moduleRef);
  49. private:
  50. ctkCmdLineModuleManager* ModuleManager;
  51. };
  52. #endif // CTKCMDLINEMODULECONCURRENTHELPERS_H