Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

FltRecordWriter Class Reference

This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly. More...

#include <fltRecordWriter.h>

List of all members.

Public Member Functions

 FltRecordWriter (ostream &out)
 ~FltRecordWriter ()
void set_opcode (FltOpcode opcode)
 Sets the opcode associated with the current record.

const Datagramget_datagram () const
void set_datagram (const Datagram &datagram)
 Sets the datagram that will be written when advance() is called.

Datagramupdate_datagram ()
 Returns a modifiable reference to the datagram associated with the current record.

FltError advance ()
 Writes the current record to the flt file, and resets the current record to receive new data.

FltError write_record (FltOpcode opcode, const Datagram &datagram=Datagram())
 A convenience function to quickly write a simple record that consists of an opcode and possibly a datagram.

FltError write_instance_def (FltHeader *header, int instance_index)
 Ensures that the given instance definition has already been written to the file.


Private Types

typedef pset< intInstances

Private Attributes

ostream & _out
Datagram _datagram
FltOpcode _opcode
Instances _instances_written


Detailed Description

This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly.

Definition at line 44 of file fltRecordWriter.h.


Member Typedef Documentation

typedef pset<int> FltRecordWriter::Instances [private]
 

Definition at line 66 of file fltRecordWriter.h.


Constructor & Destructor Documentation

FltRecordWriter::FltRecordWriter ostream &  out  ) 
 

Definition at line 44 of file fltRecordWriter.cxx.

FltRecordWriter::~FltRecordWriter  ) 
 

Definition at line 57 of file fltRecordWriter.cxx.

References _opcode.


Member Function Documentation

FltError FltRecordWriter::advance  ) 
 

Writes the current record to the flt file, and resets the current record to receive new data.

Returns FE_ok on success, or something else on error.

Definition at line 122 of file fltRecordWriter.cxx.

References _datagram, _out, FE_write_error, and flt_error_abort.

const Datagram& FltRecordWriter::get_datagram  )  const
 

void FltRecordWriter::set_datagram const Datagram datagram  ) 
 

Sets the datagram that will be written when advance() is called.

Definition at line 84 of file fltRecordWriter.cxx.

References _datagram.

void FltRecordWriter::set_opcode FltOpcode  opcode  ) 
 

Sets the opcode associated with the current record.

Definition at line 69 of file fltRecordWriter.cxx.

References _datagram.

Datagram & FltRecordWriter::update_datagram  ) 
 

Returns a modifiable reference to the datagram associated with the current record.

This datagram should then be stuffed with data corresponding to the data in the record, in preparation for calling advance() to write the data.

Definition at line 105 of file fltRecordWriter.cxx.

FltError FltRecordWriter::write_instance_def FltHeader header,
int  instance_index
 

Ensures that the given instance definition has already been written to the file.

If it has not, writes it now.

Definition at line 199 of file fltRecordWriter.cxx.

FltError FltRecordWriter::write_record FltOpcode  opcode,
const Datagram datagram = Datagram()
 

A convenience function to quickly write a simple record that consists of an opcode and possibly a datagram.

Definition at line 180 of file fltRecordWriter.cxx.


Member Data Documentation

Datagram FltRecordWriter::_datagram [private]
 

Definition at line 63 of file fltRecordWriter.h.

Referenced by advance(), set_datagram(), and set_opcode().

Instances FltRecordWriter::_instances_written [private]
 

Definition at line 67 of file fltRecordWriter.h.

FltOpcode FltRecordWriter::_opcode [private]
 

Definition at line 64 of file fltRecordWriter.h.

Referenced by ~FltRecordWriter().

ostream& FltRecordWriter::_out [private]
 

Definition at line 62 of file fltRecordWriter.h.

Referenced by advance().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:26:54 2003 for Panda-Tool by doxygen1.3