cppExtensionType.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file cppExtensionType.h
  10. * @author drose
  11. * @date 1999-10-21
  12. */
  13. #ifndef CPPEXTENSIONTYPE_H
  14. #define CPPEXTENSIONTYPE_H
  15. #include "dtoolbase.h"
  16. #include "cppType.h"
  17. #include "cppInstance.h"
  18. class CPPScope;
  19. class CPPIdentifier;
  20. /**
  21. * Base class of enum, class, struct, and union types. An instance of the
  22. * base class (instead of one of the specializations) is used for forward
  23. * references.
  24. */
  25. class CPPExtensionType : public CPPType {
  26. public:
  27. enum Type {
  28. T_enum,
  29. T_class,
  30. T_struct,
  31. T_union,
  32. T_enum_class,
  33. T_enum_struct,
  34. };
  35. CPPExtensionType(Type type, CPPIdentifier *ident, CPPScope *current_scope,
  36. const CPPFile &file);
  37. virtual std::string get_simple_name() const;
  38. virtual std::string get_local_name(CPPScope *scope = nullptr) const;
  39. virtual std::string get_fully_scoped_name() const;
  40. virtual bool is_incomplete() const;
  41. virtual bool is_tbd() const;
  42. virtual bool is_standard_layout() const;
  43. virtual bool is_trivial() const;
  44. virtual bool is_constructible(const CPPType *type) const;
  45. virtual bool is_default_constructible() const;
  46. virtual bool is_copy_constructible() const;
  47. virtual bool is_copy_assignable() const;
  48. virtual CPPDeclaration *substitute_decl(SubstDecl &subst,
  49. CPPScope *current_scope,
  50. CPPScope *global_scope);
  51. virtual CPPType *resolve_type(CPPScope *current_scope,
  52. CPPScope *global_scope);
  53. virtual bool is_equivalent(const CPPType &other) const;
  54. virtual void output(std::ostream &out, int indent_level, CPPScope *scope,
  55. bool complete) const;
  56. virtual SubType get_subtype() const;
  57. virtual CPPExtensionType *as_extension_type();
  58. Type _type;
  59. CPPIdentifier *_ident;
  60. CPPExpression *_alignment;
  61. };
  62. std::ostream &operator << (std::ostream &out, CPPExtensionType::Type type);
  63. #endif