cmData.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmData_h
  11. #define cmData_h
  12. #include "cmStandardIncludes.h"
  13. /** \class cmData
  14. * \brief Hold extra data on a cmMakefile instance for a command.
  15. *
  16. * When CMake commands need to store extra information in a cmMakefile
  17. * instance, but the information is not needed by the makefile generators,
  18. * it can be held in a subclass of cmData. The cmMakefile class has a map
  19. * from std::string to cmData*. On its destruction, it destroys all the
  20. * extra data through the virtual destructor of cmData.
  21. */
  22. class cmData
  23. {
  24. public:
  25. cmData(const char* name): Name(name) {}
  26. virtual ~cmData() {}
  27. const std::string& GetName() const
  28. { return this->Name; }
  29. protected:
  30. std::string Name;
  31. };
  32. #endif