cppTemplateScope.h 2.2 KB

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