Panda3D

Loading...
Searching...
No Matches
interrogateMakeSeq.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file interrogateMakeSeq.cxx
10 * @author drose
11 * @date 2009-09-15
12 */
13
14#include "interrogateMakeSeq.h"
15#include "indexRemapper.h"
16#include "interrogate_datafile.h"
17
18/**
19 * Formats the InterrogateMakeSeq data for output to a data file.
20 */
21 void InterrogateMakeSeq::
22 output(std::ostream &out) const {
23 InterrogateComponent::output(out);
24 out << _length_getter << " "
25 << _element_getter << " ";
26 idf_output_string(out, _scoped_name);
27 idf_output_string(out, _comment, '\n');
28}
29
30/**
31 * Reads the data file as previously formatted by output().
32 */
33 void InterrogateMakeSeq::
34 input(std::istream &in) {
35 InterrogateComponent::input(in);
36
37 in >> _length_getter >> _element_getter;
38 idf_input_string(in, _scoped_name);
39 idf_input_string(in, _comment);
40}
41
42/**
43 * Remaps all internal index numbers according to the indicated map. This
44 * called from InterrogateDatabase::remap_indices().
45 */
46 void InterrogateMakeSeq::
47 remap_indices(const IndexRemapper &remap) {
48 _length_getter = remap.map_from(_length_getter);
49 _element_getter = remap.map_from(_element_getter);
50}
IndexRemapper
This class manages a mapping of integers to integers.
Definition indexRemapper.h:29
IndexRemapper::map_from
int map_from(int from) const
Returns the integer that the given 'from' integer had been set to map to, or the same integer if noth...
Definition indexRemapper.cxx:61
InterrogateComponent::input
void input(std::istream &in)
Reads the data file as previously formatted by output().
Definition interrogateComponent.cxx:39
InterrogateComponent::output
void output(std::ostream &out) const
Formats the component for output to a data file.
Definition interrogateComponent.cxx:25
InterrogateMakeSeq::input
void input(std::istream &in)
Reads the data file as previously formatted by output().
Definition interrogateMakeSeq.cxx:34
InterrogateMakeSeq::remap_indices
void remap_indices(const IndexRemapper &remap)
Remaps all internal index numbers according to the indicated map.
Definition interrogateMakeSeq.cxx:47
InterrogateMakeSeq::output
void output(std::ostream &out) const
Formats the InterrogateMakeSeq data for output to a data file.
Definition interrogateMakeSeq.cxx:22
indexRemapper.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
interrogateMakeSeq.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
idf_input_string
void idf_input_string(istream &in, string &str)
Reads the given string from the input file, as previously written by output_string().
Definition interrogate_datafile.cxx:38
idf_output_string
void idf_output_string(ostream &out, const string &str, char whitespace)
Writes the indicated string to the output file.
Definition interrogate_datafile.cxx:26
interrogate_datafile.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.