Panda3D
fltUnsupportedRecord.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 fltUnsupportedRecord.cxx
10  * @author drose
11  * @date 2000-08-24
12  */
13 
14 #include "fltUnsupportedRecord.h"
15 #include "fltRecordReader.h"
16 #include "fltRecordWriter.h"
17 
18 TypeHandle FltUnsupportedRecord::_type_handle;
19 
20 /**
21  *
22  */
23 FltUnsupportedRecord::
24 FltUnsupportedRecord(FltHeader *header) : FltRecord(header) {
25  _opcode = FO_none;
26 }
27 
28 /**
29  * Writes a quick one-line description of the bead, but not its children.
30  * This is a human-readable description, primarily for debugging; to write a
31  * flt file, use FltHeader::write_flt().
32  */
34 output(std::ostream &out) const {
35  out << "Unsupported(" << _opcode << ")";
36 }
37 
38 /**
39  * Fills in the information in this bead based on the information given in the
40  * indicated datagram, whose opcode has already been read. Returns true on
41  * success, false if the datagram is invalid.
42  */
43 bool FltUnsupportedRecord::
44 extract_record(FltRecordReader &reader) {
45  _opcode = reader.get_opcode();
46  _datagram = reader.get_datagram();
47 
48  return true;
49 }
50 
51 /**
52  * Fills up the current record on the FltRecordWriter with data for this
53  * record, but does not advance the writer. Returns true on success, false if
54  * there is some error.
55  */
56 bool FltUnsupportedRecord::
57 build_record(FltRecordWriter &writer) const {
58  writer.set_opcode(_opcode);
59  writer.set_datagram(_datagram);
60  return true;
61 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly.
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_datagram(const Datagram &datagram)
Sets the datagram that will be written when advance() is called.
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:44
const Datagram & get_datagram()
Returns the datagram representing the entire record, less the four-byte header.
virtual void output(std::ostream &out) const
Writes a quick one-line description of the bead, but not its children.
The base class for all kinds of records in a MultiGen OpenFlight file.
Definition: fltRecord.h:36
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
FltOpcode get_opcode() const
Returns the opcode associated with the current record.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
void set_opcode(FltOpcode opcode)
Sets the opcode associated with the current record.