cppReferenceType.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Filename: cppReferenceType.h
  2. // Created by: drose (19Oct99)
  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 CPPREFERENCETYPE_H
  15. #define CPPREFERENCETYPE_H
  16. #include "dtoolbase.h"
  17. #include "cppType.h"
  18. ///////////////////////////////////////////////////////////////////
  19. // Class : CPPReferenceType
  20. // Description : Either an lvalue- or rvalue-reference.
  21. ////////////////////////////////////////////////////////////////////
  22. class CPPReferenceType : public CPPType {
  23. public:
  24. enum ValueCategory {
  25. VC_lvalue,
  26. VC_rvalue
  27. };
  28. CPPReferenceType(CPPType *pointing_at, ValueCategory vcat=VC_lvalue);
  29. CPPType *_pointing_at;
  30. ValueCategory _value_category;
  31. virtual bool is_fully_specified() const;
  32. virtual CPPDeclaration *substitute_decl(SubstDecl &subst,
  33. CPPScope *current_scope,
  34. CPPScope *global_scope);
  35. virtual CPPType *resolve_type(CPPScope *current_scope,
  36. CPPScope *global_scope);
  37. virtual bool is_tbd() const;
  38. virtual bool is_trivial() const;
  39. virtual bool is_equivalent(const CPPType &other) const;
  40. virtual void output(ostream &out, int indent_level, CPPScope *scope,
  41. bool complete) const;
  42. virtual void output_instance(ostream &out, int indent_level,
  43. CPPScope *scope,
  44. bool complete, const string &prename,
  45. const string &name) const;
  46. virtual SubType get_subtype() const;
  47. virtual CPPReferenceType *as_reference_type();
  48. protected:
  49. virtual bool is_equal(const CPPDeclaration *other) const;
  50. virtual bool is_less(const CPPDeclaration *other) const;
  51. };
  52. #endif