Panda3D
Loading...
Searching...
No Matches
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
15#include "fltRecordReader.h"
16#include "fltRecordWriter.h"
17
18TypeHandle FltUnsupportedRecord::_type_handle;
19
20/**
21 *
22 */
23FltUnsupportedRecord::
24FltUnsupportedRecord(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 */
34output(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 */
43bool FltUnsupportedRecord::
44extract_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 */
56bool FltUnsupportedRecord::
57build_record(FltRecordWriter &writer) const {
58 writer.set_opcode(_opcode);
59 writer.set_datagram(_datagram);
60 return true;
61}
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition fltHeader.h:44
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
FltOpcode get_opcode() const
Returns the opcode associated with the current record.
const Datagram & get_datagram()
Returns the datagram representing the entire record, less the four-byte header.
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly.
void set_datagram(const Datagram &datagram)
Sets the datagram that will be written when advance() is called.
void set_opcode(FltOpcode opcode)
Sets the opcode associated with the current record.
The base class for all kinds of records in a MultiGen OpenFlight file.
Definition fltRecord.h:36
virtual void output(std::ostream &out) const
Writes a quick one-line description of the bead, but not its children.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.