cmCableClassSet.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCableClassSet_h
  14. #define cmCableClassSet_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmData.h"
  17. #include "cmMakefile.h"
  18. /** \class cmCableClass
  19. * \brief Holds one class and the set of header files needed to use it.
  20. */
  21. class cmCableClass
  22. {
  23. public:
  24. typedef std::set<cmStdString> Sources;
  25. cmCableClass() {}
  26. cmCableClass(const cmStdString& tag): m_Tag(tag) {}
  27. void AddSources(const Sources& sources);
  28. void AddSource(const char*);
  29. Sources::const_iterator SourcesBegin() const { return m_Sources.begin(); }
  30. Sources::const_iterator SourcesEnd() const { return m_Sources.end(); }
  31. const cmStdString& GetTag() const { return m_Tag; }
  32. private:
  33. /**
  34. * The tag name of this class.
  35. */
  36. cmStdString m_Tag;
  37. /**
  38. * Store the set of source files (headers) needed to define this class.
  39. */
  40. Sources m_Sources;
  41. };
  42. /** \class cmCableClassSet
  43. * \brief Holds a set of classes, each with their own set of required headers.
  44. */
  45. class cmCableClassSet: public cmData
  46. {
  47. public:
  48. cmCableClassSet(const char* name): cmData(name) {}
  49. virtual ~cmCableClassSet();
  50. /**
  51. * The set is stored internally as a map from class name to cmCableClass
  52. * instance.
  53. */
  54. typedef std::map<cmStdString, cmCableClass*> CableClassMap;
  55. void AddClass(const char*, cmCableClass*);
  56. void AddSource(const char* name);
  57. unsigned int Size() const;
  58. CableClassMap::const_iterator Begin() const;
  59. CableClassMap::const_iterator End() const;
  60. void ParseAndAddElement(const char*, cmMakefile*);
  61. private:
  62. /**
  63. * The set is stored internally as a map from class name to cmCableClass
  64. * instance.
  65. */
  66. CableClassMap m_CableClassMap;
  67. };
  68. #endif