00001 // Filename: parameterRemapConstToNonConst.cxx 00002 // Created by: drose (04Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include "parameterRemapConstToNonConst.h" 00020 #include "typeManager.h" 00021 00022 #include <cppConstType.h> 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Function: ParameterRemapConstToNonConst::Constructor 00026 // Access: Public 00027 // Description: 00028 //////////////////////////////////////////////////////////////////// 00029 ParameterRemapConstToNonConst:: 00030 ParameterRemapConstToNonConst(CPPType *orig_type) : 00031 ParameterRemap(orig_type) 00032 { 00033 _new_type = TypeManager::unwrap_const(orig_type); 00034 } 00035 00036 //////////////////////////////////////////////////////////////////// 00037 // Function: ParameterRemapConstToNonConst::pass_parameter 00038 // Access: Public, Virtual 00039 // Description: Outputs an expression that converts the indicated 00040 // variable from the new type to the original type, for 00041 // passing into the actual C++ function. 00042 //////////////////////////////////////////////////////////////////// 00043 void ParameterRemapConstToNonConst:: 00044 pass_parameter(ostream &out, const string &variable_name) { 00045 out << variable_name; 00046 } 00047 00048 //////////////////////////////////////////////////////////////////// 00049 // Function: ParameterRemapConstToNonConst::get_return_expr 00050 // Access: Public, Virtual 00051 // Description: Returns an expression that evalutes to the 00052 // appropriate value type for returning from the 00053 // function, given an expression of the original type. 00054 //////////////////////////////////////////////////////////////////// 00055 string ParameterRemapConstToNonConst:: 00056 get_return_expr(const string &expression) { 00057 return expression; 00058 }