parameterRemapConstToNonConst.cxx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Filename: parameterRemapConstToNonConst.C
  2. // Created by: drose (04Aug00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #include "parameterRemapConstToNonConst.h"
  6. #include "typeManager.h"
  7. #include <cppConstType.h>
  8. ////////////////////////////////////////////////////////////////////
  9. // Function: ParameterRemapConstToNonConst::Constructor
  10. // Access: Public
  11. // Description:
  12. ////////////////////////////////////////////////////////////////////
  13. ParameterRemapConstToNonConst::
  14. ParameterRemapConstToNonConst(CPPType *orig_type) :
  15. ParameterRemap(orig_type)
  16. {
  17. _new_type = TypeManager::unwrap_const(orig_type);
  18. }
  19. ////////////////////////////////////////////////////////////////////
  20. // Function: ParameterRemapConstToNonConst::pass_parameter
  21. // Access: Public, Virtual
  22. // Description: Outputs an expression that converts the indicated
  23. // variable from the new type to the original type, for
  24. // passing into the actual C++ function.
  25. ////////////////////////////////////////////////////////////////////
  26. void ParameterRemapConstToNonConst::
  27. pass_parameter(ostream &out, const string &variable_name) {
  28. out << variable_name;
  29. }
  30. ////////////////////////////////////////////////////////////////////
  31. // Function: ParameterRemapConstToNonConst::get_return_expr
  32. // Access: Public, Virtual
  33. // Description: Returns an expression that evalutes to the
  34. // appropriate value type for returning from the
  35. // function, given an expression of the original type.
  36. ////////////////////////////////////////////////////////////////////
  37. string ParameterRemapConstToNonConst::
  38. get_return_expr(const string &expression) {
  39. return expression;
  40. }