ctkAbstractFileBasedFactory.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.commontk.org/LICENSE
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkAbstractFileBasedFactory_h
  15. #define __ctkAbstractFileBasedFactory_h
  16. // Qt includes
  17. #include <QFileInfo>
  18. #include <QStringList>
  19. // CTK includes
  20. #include "ctkAbstractFactory.h"
  21. //----------------------------------------------------------------------------
  22. /// \ingroup Core
  23. template<typename BaseClassType>
  24. class ctkAbstractFactoryFileBasedItem : public ctkAbstractFactoryItem<BaseClassType>
  25. {
  26. public:
  27. explicit ctkAbstractFactoryFileBasedItem(const QString& path);
  28. /// Get path associated with the object identified by \a key
  29. QString path()const;
  30. private:
  31. QString Path;
  32. };
  33. //----------------------------------------------------------------------------
  34. /// \ingroup Core
  35. template<typename BaseClassType>
  36. class ctkAbstractFileBasedFactory : public ctkAbstractFactory<BaseClassType>
  37. {
  38. public:
  39. /// Constructor
  40. explicit ctkAbstractFileBasedFactory();
  41. virtual ~ctkAbstractFileBasedFactory();
  42. /// Get path associated with the library identified by \a key
  43. virtual QString path(const QString& key);
  44. private:
  45. ctkAbstractFileBasedFactory(const ctkAbstractFileBasedFactory &); /// Not implemented
  46. void operator=(const ctkAbstractFileBasedFactory&); /// Not implemented
  47. };
  48. #include "ctkAbstractFileBasedFactory.tpp"
  49. #endif