parameterRemapEnumToInt.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Filename: parameterRemapEnumToInt.h
  2. // Created by: drose (04Aug00)
  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 PARAMETERREMAPENUMTOINT_H
  15. #define PARAMETERREMAPENUMTOINT_H
  16. #include "dtoolbase.h"
  17. #include "parameterRemap.h"
  18. ////////////////////////////////////////////////////////////////////
  19. // Class : ParameterRemapEnumToInt
  20. // Description : A ParameterRemap class that handles remapping an
  21. // enumerated type to an integer parameter.
  22. ////////////////////////////////////////////////////////////////////
  23. class ParameterRemapEnumToInt : public ParameterRemap {
  24. public:
  25. ParameterRemapEnumToInt(CPPType *orig_type);
  26. virtual void pass_parameter(ostream &out, const string &variable_name);
  27. virtual string get_return_expr(const string &expression);
  28. private:
  29. CPPType *_enum_type;
  30. CPPType *unwrap_type(CPPType *source_type) const;
  31. };
  32. #endif