00001 // Filename: parameterRemap.I 00002 // Created by: drose (01Aug00) 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 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: ParameterRemap::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE ParameterRemap:: 00026 ParameterRemap(CPPType *orig_type) : 00027 _orig_type(orig_type), 00028 _new_type(orig_type) 00029 { 00030 _is_valid = true; 00031 _temporary_type = (CPPType *)NULL; 00032 _default_value = (CPPExpression *)NULL; 00033 } 00034 00035 //////////////////////////////////////////////////////////////////// 00036 // Function: ParameterRemap::is_valid 00037 // Access: Public 00038 // Description: 00039 //////////////////////////////////////////////////////////////////// 00040 INLINE bool ParameterRemap:: 00041 is_valid() const { 00042 return _is_valid; 00043 } 00044 00045 //////////////////////////////////////////////////////////////////// 00046 // Function: ParameterRemap::get_orig_type 00047 // Access: Public 00048 // Description: Returns the type of the original, C++ parameter or 00049 // return value. 00050 //////////////////////////////////////////////////////////////////// 00051 INLINE CPPType *ParameterRemap:: 00052 get_orig_type() const { 00053 return _orig_type; 00054 } 00055 00056 //////////////////////////////////////////////////////////////////// 00057 // Function: ParameterRemap::get_new_type 00058 // Access: Public 00059 // Description: Returns the type of the wrapper's parameter or return 00060 // value. This is the type that will be reported in the 00061 // interrogate database, and the type that the scripting 00062 // language is expected to deal with. 00063 //////////////////////////////////////////////////////////////////// 00064 INLINE CPPType *ParameterRemap:: 00065 get_new_type() const { 00066 return _new_type; 00067 } 00068 00069 //////////////////////////////////////////////////////////////////// 00070 // Function: ParameterRemap::get_temporary_type 00071 // Access: Public 00072 // Description: Returns the type of any temporary variables used to 00073 // hold the return value before returning it. This is 00074 // normally the same as get_new_type(), but in some 00075 // circumstances it may need to be different. 00076 //////////////////////////////////////////////////////////////////// 00077 INLINE CPPType *ParameterRemap:: 00078 get_temporary_type() const { 00079 if (_temporary_type == (CPPType *)NULL) { 00080 return _new_type; 00081 } else { 00082 return _temporary_type; 00083 } 00084 } 00085 00086 //////////////////////////////////////////////////////////////////// 00087 // Function: ParameterRemap::has_default_value 00088 // Access: Public 00089 // Description: Returns true if this particular parameter has a 00090 // default value defined. 00091 //////////////////////////////////////////////////////////////////// 00092 INLINE bool ParameterRemap:: 00093 has_default_value() const { 00094 return (_default_value != (CPPExpression *)NULL); 00095 } 00096 00097 //////////////////////////////////////////////////////////////////// 00098 // Function: ParameterRemap::get_default_value 00099 // Access: Public 00100 // Description: Returns the expression corresponding to this parameter's 00101 // default value. 00102 //////////////////////////////////////////////////////////////////// 00103 INLINE CPPExpression *ParameterRemap:: 00104 get_default_value() const { 00105 return _default_value; 00106 } 00107 00108 //////////////////////////////////////////////////////////////////// 00109 // Function: ParameterRemap::set_default_value 00110 // Access: Public 00111 // Description: Records a default value to be associated with this 00112 // parameter. 00113 //////////////////////////////////////////////////////////////////// 00114 INLINE void ParameterRemap:: 00115 set_default_value(CPPExpression *expr) { 00116 _default_value = expr; 00117 }