00001 // Filename: parameterRemapThis.cxx 00002 // Created by: drose (02Aug00) 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 "parameterRemapThis.h" 00020 #include "typeManager.h" 00021 00022 #include "cppType.h" 00023 #include "cppSimpleType.h" 00024 #include "cppPointerType.h" 00025 #include "cppConstType.h" 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Function: ParameterRemapThis::Constructor 00029 // Access: Public 00030 // Description: 00031 //////////////////////////////////////////////////////////////////// 00032 ParameterRemapThis:: 00033 ParameterRemapThis(CPPType *type, bool is_const) : 00034 ParameterRemap(TypeManager::get_void_type()) 00035 { 00036 if (is_const) { 00037 _new_type = TypeManager::wrap_const_pointer(type); 00038 } else { 00039 _new_type = TypeManager::wrap_pointer(type); 00040 } 00041 } 00042 00043 //////////////////////////////////////////////////////////////////// 00044 // Function: ParameterRemapThis::pass_parameter 00045 // Access: Public, Virtual 00046 // Description: Outputs an expression that converts the indicated 00047 // variable from the new type to the original type, for 00048 // passing into the actual C++ function. 00049 //////////////////////////////////////////////////////////////////// 00050 void ParameterRemapThis:: 00051 pass_parameter(ostream &out, const string &) { 00052 out << "**invalid**"; 00053 } 00054 00055 //////////////////////////////////////////////////////////////////// 00056 // Function: ParameterRemapThis::get_return_expr 00057 // Access: Public, Virtual 00058 // Description: Returns an expression that evalutes to the 00059 // appropriate value type for returning from the 00060 // function, given an expression of the original type. 00061 //////////////////////////////////////////////////////////////////// 00062 string ParameterRemapThis:: 00063 get_return_expr(const string &) { 00064 return "**invalid**"; 00065 } 00066 00067 //////////////////////////////////////////////////////////////////// 00068 // Function: ParameterRemapThis::is_this 00069 // Access: Public, Virtual 00070 // Description: Returns true if this is the "this" parameter. 00071 //////////////////////////////////////////////////////////////////// 00072 bool ParameterRemapThis:: 00073 is_this() { 00074 return true; 00075 }