36 return _header->get_instance(_instance_index);
45write(std::ostream &out,
int indent_level)
const {
46 indent(out, indent_level) <<
"instance";
49 def->write_children(out, indent_level + 2);
50 indent(out, indent_level) <<
"}\n";
63 if (!FltBead::extract_record(reader)) {
67 nassertr(reader.
get_opcode() == FO_instance_ref,
false);
82FltError FltInstanceRef::
86 if (result != FE_ok) {
91 return FltBead::write_record_and_children(writer);
101 if (!FltBead::build_record(writer)) {
A class to retrieve the individual data elements previously stored in a Datagram.
void skip_bytes(size_t size)
Skips over the indicated number of bytes in the datagram.
int16_t get_be_int16()
Extracts a signed 16-bit big-endian integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_be_int16(int16_t value)
Adds a signed 16-bit big-endian integer to the datagram.
void pad_bytes(size_t size)
Adds the indicated number of zero bytes to the datagram.
A base class for any of a broad family of flt records that represent particular beads in the hierarch...
This special kind of record marks the top node of an instance subtree.
virtual void write(std::ostream &out, int indent_level=0) const
Writes a multiple-line description of the record and all of its children.
FltInstanceDefinition * get_instance() const
Returns the instance subtree referenced by this node, or NULL if the reference is invalid.
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.
DatagramIterator & get_iterator()
Returns an iterator suitable for extracting data from the current record.
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly.
FltError write_instance_def(FltHeader *header, int instance_index)
Ensures that the given instance definition has already been written to the file.
void set_opcode(FltOpcode opcode)
Sets the opcode associated with the current record.
Datagram & update_datagram()
Returns a modifiable reference to the datagram associated with the current record.
void check_remaining_size(const DatagramIterator &di, const std::string &name=std::string()) const
Checks that the iterator has no bytes left, as it should at the end of a successfully read record.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.