00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "interrogateFunction.h"
00016 #include "indexRemapper.h"
00017 #include "interrogate_datafile.h"
00018 #include "interrogateDatabase.h"
00019
00020
00021
00022
00023
00024
00025 InterrogateFunction::
00026 InterrogateFunction(InterrogateModuleDef *def) :
00027 InterrogateComponent(def)
00028 {
00029 _flags = 0;
00030 _class = 0;
00031 _instances = (Instances *)NULL;
00032 }
00033
00034
00035
00036
00037
00038
00039 InterrogateFunction::
00040 InterrogateFunction(const InterrogateFunction ©) {
00041 (*this) = copy;
00042 }
00043
00044
00045
00046
00047
00048
00049 void InterrogateFunction::
00050 operator = (const InterrogateFunction ©) {
00051 InterrogateComponent::operator = (copy);
00052 _flags = copy._flags;
00053 _scoped_name = copy._scoped_name;
00054 _comment = copy._comment;
00055 _prototype = copy._prototype;
00056 _class = copy._class;
00057 _c_wrappers = copy._c_wrappers;
00058 _python_wrappers = copy._python_wrappers;
00059
00060 _instances = copy._instances;
00061 _expression = copy._expression;
00062 }
00063
00064
00065
00066
00067
00068
00069
00070 void InterrogateFunction::
00071 output(ostream &out) const {
00072 InterrogateComponent::output(out);
00073 out << _flags << " "
00074 << _class << " ";
00075 idf_output_string(out, _scoped_name);
00076 idf_output_vector(out, _c_wrappers);
00077 idf_output_vector(out, _python_wrappers);
00078 idf_output_string(out, _comment, '\n');
00079 idf_output_string(out, _prototype, '\n');
00080 }
00081
00082
00083
00084
00085
00086
00087
00088 void InterrogateFunction::
00089 input(istream &in) {
00090 InterrogateComponent::input(in);
00091 in >> _flags >> _class;
00092 idf_input_string(in, _scoped_name);
00093 idf_input_vector(in, _c_wrappers);
00094 idf_input_vector(in, _python_wrappers);
00095 idf_input_string(in, _comment);
00096
00097 if (InterrogateDatabase::get_file_minor_version() >= 2) {
00098 idf_input_string(in, _prototype);
00099 }
00100 }
00101
00102
00103
00104
00105
00106
00107
00108
00109 void InterrogateFunction::
00110 remap_indices(const IndexRemapper &remap) {
00111 _class = remap.map_from(_class);
00112 Wrappers::iterator wi;
00113 for (wi = _c_wrappers.begin(); wi != _c_wrappers.end(); ++wi) {
00114 (*wi) = remap.map_from(*wi);
00115 }
00116 for (wi = _python_wrappers.begin(); wi != _python_wrappers.end(); ++wi) {
00117 (*wi) = remap.map_from(*wi);
00118 }
00119 }