Panda3D

interrogateElement.cxx

00001 // Filename: interrogateElement.cxx
00002 // Created by:  drose (11Aug00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "interrogateElement.h"
00016 #include "indexRemapper.h"
00017 #include "interrogate_datafile.h"
00018 
00019 ////////////////////////////////////////////////////////////////////
00020 //     Function: InterrogateElement::output
00021 //       Access: Public
00022 //  Description: Formats the InterrogateElement data for output to a data
00023 //               file.
00024 ////////////////////////////////////////////////////////////////////
00025 void InterrogateElement::
00026 output(ostream &out) const {
00027   InterrogateComponent::output(out);
00028   out << _flags << " "
00029       << _type << " "
00030       << _getter << " "
00031       << _setter << " ";
00032   idf_output_string(out, _scoped_name);
00033 }
00034 
00035 ////////////////////////////////////////////////////////////////////
00036 //     Function: InterrogateElement::input
00037 //       Access: Public
00038 //  Description: Reads the data file as previously formatted by
00039 //               output().
00040 ////////////////////////////////////////////////////////////////////
00041 void InterrogateElement::
00042 input(istream &in) {
00043   InterrogateComponent::input(in);
00044   in >> _flags >> _type >> _getter >> _setter;
00045   idf_input_string(in, _scoped_name);
00046 }
00047 
00048 ////////////////////////////////////////////////////////////////////
00049 //     Function: InterrogateElement::remap_indices
00050 //       Access: Public
00051 //  Description: Remaps all internal index numbers according to the
00052 //               indicated map.  This called from
00053 //               InterrogateDatabase::remap_indices().
00054 ////////////////////////////////////////////////////////////////////
00055 void InterrogateElement::
00056 remap_indices(const IndexRemapper &remap) {
00057   _type = remap.map_from(_type);
00058   _getter = remap.map_from(_getter);
00059   _setter = remap.map_from(_setter);
00060 }
 All Classes Functions Variables Enumerations