cppTemplateScope.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Filename: cppTemplateScope.h
  2. // Created by: drose (28Oct99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. #ifndef CPPTEMPLATESCOPE_H
  15. #define CPPTEMPLATESCOPE_H
  16. #include "dtoolbase.h"
  17. #include "cppScope.h"
  18. #include "cppTemplateParameterList.h"
  19. ///////////////////////////////////////////////////////////////////
  20. // Class : CPPTemplateScope
  21. // Description : This is an implicit scope that is created following
  22. // the appearance of a "template<class x, class y>" or
  23. // some such line in a C++ file. It simply defines the
  24. // template parameters.
  25. ////////////////////////////////////////////////////////////////////
  26. class CPPTemplateScope : public CPPScope {
  27. public:
  28. CPPTemplateScope(CPPScope *parent_scope);
  29. void add_template_parameter(CPPDeclaration *param);
  30. virtual void add_declaration(CPPDeclaration *decl, CPPScope *global_scope,
  31. CPPPreprocessor *preprocessor,
  32. const cppyyltype &pos);
  33. virtual void add_enum_value(CPPInstance *inst);
  34. virtual void define_extension_type(CPPExtensionType *type);
  35. virtual void define_namespace(CPPNamespace *scope);
  36. virtual void add_using(CPPUsing *using_decl, CPPScope *global_scope,
  37. CPPPreprocessor *error_sink = NULL);
  38. virtual bool is_fully_specified() const;
  39. virtual string get_simple_name() const;
  40. virtual string get_local_name(CPPScope *scope = NULL) const;
  41. virtual string get_fully_scoped_name() const;
  42. virtual void output(ostream &out, CPPScope *scope) const;
  43. virtual CPPTemplateScope *as_template_scope();
  44. CPPTemplateParameterList _parameters;
  45. };
  46. #endif