cppSimpleType.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Filename: cppSimpleType.h
  2. // Created by: drose (19Oct99)
  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 CPPSIMPLETYPE_H
  19. #define CPPSIMPLETYPE_H
  20. #include <dtoolbase.h>
  21. #include "cppType.h"
  22. ///////////////////////////////////////////////////////////////////
  23. // Class : CPPSimpleType
  24. // Description :
  25. ////////////////////////////////////////////////////////////////////
  26. class CPPSimpleType : public CPPType {
  27. public:
  28. enum Type {
  29. T_bool,
  30. T_char,
  31. T_int,
  32. T_float,
  33. T_double,
  34. T_void,
  35. T_unknown,
  36. };
  37. enum Flags {
  38. F_long = 0x001,
  39. F_longlong = 0x002,
  40. F_short = 0x004,
  41. F_unsigned = 0x008,
  42. F_signed = 0x010,
  43. };
  44. CPPSimpleType(Type type, int flags = 0);
  45. Type _type;
  46. int _flags;
  47. virtual bool is_tbd() const;
  48. virtual string get_preferred_name() const;
  49. virtual void output(ostream &out, int indent_level, CPPScope *scope,
  50. bool complete) const;
  51. virtual SubType get_subtype() const;
  52. virtual CPPSimpleType *as_simple_type();
  53. protected:
  54. virtual bool is_equal(const CPPDeclaration *other) const;
  55. virtual bool is_less(const CPPDeclaration *other) const;
  56. };
  57. #endif