Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

dtool/src/interrogatedb/interrogateFunction.cxx

Go to the documentation of this file.
00001 // Filename: interrogateFunction.cxx
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 #include "interrogateFunction.h"
00020 #include "indexRemapper.h"
00021 #include "interrogate_datafile.h"
00022 #include "interrogateDatabase.h"
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //     Function: InterrogateFunction::Copy Assignment Operator
00026 //       Access: Public
00027 //  Description:
00028 ////////////////////////////////////////////////////////////////////
00029 void InterrogateFunction::
00030 operator = (const InterrogateFunction &copy) {
00031   InterrogateComponent::operator = (copy);
00032   _flags = copy._flags;
00033   _scoped_name = copy._scoped_name;
00034   _comment = copy._comment;
00035   _prototype = copy._prototype;
00036   _class = copy._class;
00037   _c_wrappers = copy._c_wrappers;
00038   _python_wrappers = copy._python_wrappers;
00039 
00040   _instances = copy._instances;
00041   _expression = copy._expression;
00042 }
00043 
00044 ////////////////////////////////////////////////////////////////////
00045 //     Function: InterrogateFunction::output
00046 //       Access: Public
00047 //  Description: Formats the InterrogateFunction data for output to a data
00048 //               file.
00049 ////////////////////////////////////////////////////////////////////
00050 void InterrogateFunction::
00051 output(ostream &out) const {
00052   InterrogateComponent::output(out);
00053   out << _flags << " "
00054       << _class << " ";
00055   idf_output_string(out, _scoped_name);
00056   idf_output_vector(out, _c_wrappers);
00057   idf_output_vector(out, _python_wrappers);
00058   idf_output_string(out, _comment, '\n');
00059   idf_output_string(out, _prototype, '\n');
00060 }
00061 
00062 ////////////////////////////////////////////////////////////////////
00063 //     Function: InterrogateFunction::input
00064 //       Access: Public
00065 //  Description: Reads the data file as previously formatted by
00066 //               output().
00067 ////////////////////////////////////////////////////////////////////
00068 void InterrogateFunction::
00069 input(istream &in) {
00070   InterrogateComponent::input(in);
00071   in >> _flags >> _class;
00072   idf_input_string(in, _scoped_name);
00073   idf_input_vector(in, _c_wrappers);
00074   idf_input_vector(in, _python_wrappers);
00075   idf_input_string(in, _comment);
00076 
00077   if (InterrogateDatabase::get_file_minor_version() >= 2) {
00078     idf_input_string(in, _prototype);
00079   }
00080 }
00081 
00082 ////////////////////////////////////////////////////////////////////
00083 //     Function: InterrogateFunction::remap_indices
00084 //       Access: Public
00085 //  Description: Remaps all internal index numbers according to the
00086 //               indicated map.  This called from
00087 //               InterrogateDatabase::remap_indices().
00088 ////////////////////////////////////////////////////////////////////
00089 void InterrogateFunction::
00090 remap_indices(const IndexRemapper &remap) {
00091   _class = remap.map_from(_class);
00092   Wrappers::iterator wi;
00093   for (wi = _c_wrappers.begin(); wi != _c_wrappers.end(); ++wi) {
00094     (*wi) = remap.map_from(*wi);
00095   }
00096   for (wi = _python_wrappers.begin(); wi != _python_wrappers.end(); ++wi) {
00097     (*wi) = remap.map_from(*wi);
00098   }
00099 }

Generated on Thu May 1 22:13:06 2003 for DTool by doxygen1.3