Panda3D
Loading...
Searching...
No Matches
Public Member Functions | List of all members
FltRecordReader Class Reference

This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extracting the opcode from each one. More...

#include "fltRecordReader.h"

Public Member Functions

 FltRecordReader (std::istream &in)
 
FltError advance (bool ok_eof=false)
 Extracts the next record from the file.
 
bool eof () const
 Returns true if end-of-file has been reached without error.
 
bool error () const
 Returns true if some error has been encountered while reading (for instance, a truncated file).
 
const Datagramget_datagram ()
 Returns the datagram representing the entire record, less the four-byte header.
 
DatagramIteratorget_iterator ()
 Returns an iterator suitable for extracting data from the current record.
 
FltOpcode get_opcode () const
 Returns the opcode associated with the current record.
 
int get_record_length () const
 Returns the entire length of the record, including the four-byte header.
 

Detailed Description

This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extracting the opcode from each one.

It remembers where it is in the file and what the current record is.

Definition at line 30 of file fltRecordReader.h.

Constructor & Destructor Documentation

◆ FltRecordReader()

FltRecordReader::FltRecordReader ( std::istream & in)

Definition at line 24 of file fltRecordReader.cxx.

◆ ~FltRecordReader()

FltRecordReader::~FltRecordReader ( )

Definition at line 43 of file fltRecordReader.cxx.

Member Function Documentation

◆ advance()

FltError FltRecordReader::advance ( bool ok_eof = false)

Extracts the next record from the file.

Returns true if there is another record, or false if the end of file has been reached.

Definition at line 94 of file fltRecordReader.cxx.

References Datagram::append_data().

Referenced by FltHeader::read_flt().

◆ eof()

bool FltRecordReader::eof ( ) const

Returns true if end-of-file has been reached without error.

Definition at line 198 of file fltRecordReader.cxx.

Referenced by FltHeader::read_flt().

◆ error()

bool FltRecordReader::error ( ) const

Returns true if some error has been encountered while reading (for instance, a truncated file).

Definition at line 207 of file fltRecordReader.cxx.

◆ get_datagram()

const Datagram & FltRecordReader::get_datagram ( )

Returns the datagram representing the entire record, less the four-byte header.

Definition at line 73 of file fltRecordReader.cxx.

References DatagramIterator::get_datagram().

◆ get_iterator()

DatagramIterator & FltRecordReader::get_iterator ( )

Returns an iterator suitable for extracting data from the current record.

Definition at line 63 of file fltRecordReader.cxx.

Referenced by FltLocalVertexPool::extract_record().

◆ get_opcode()

FltOpcode FltRecordReader::get_opcode ( ) const

Returns the opcode associated with the current record.

Definition at line 54 of file fltRecordReader.cxx.

Referenced by FltLocalVertexPool::extract_record().

◆ get_record_length()

int FltRecordReader::get_record_length ( ) const

Returns the entire length of the record, including the four-byte header.

Definition at line 85 of file fltRecordReader.cxx.


The documentation for this class was generated from the following files: