ppSubroutine.h 913 B

12345678910111213141516171819202122232425262728293031323334
  1. // Filename: ppSubroutine.h
  2. // Created by: drose (10Oct00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef PPSUBROUTINE_H
  6. #define PPSUBROUTINE_H
  7. #include "ppremake.h"
  8. #include <vector>
  9. #include <map>
  10. ///////////////////////////////////////////////////////////////////
  11. // Class : PPSubroutine
  12. // Description : This represents a named subroutine defined via the
  13. // #defsub .. #end sequence that may be invoked at any
  14. // time via #call. All subroutine definitions are
  15. // global.
  16. ////////////////////////////////////////////////////////////////////
  17. class PPSubroutine {
  18. public:
  19. vector<string> _lines;
  20. public:
  21. static void define_sub(const string &name, PPSubroutine *sub);
  22. static const PPSubroutine *get_sub(const string &name);
  23. typedef map<string, PPSubroutine *> Subroutines;
  24. static Subroutines _subroutines;
  25. };
  26. #endif