Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
recordio::RecordWriter Class Reference

#include <recordio.h>

Public Member Functions

 RecordWriter (File *const file)
 
template<class P >
bool WriteProtocolMessage (const P &proto)
 
bool Close ()
 Closes the underlying file.
 
void set_use_compression (bool use_compression)
 

Static Public Attributes

static const int kMagicNumber = 0x3ed7230a
 Magic number when reading and writing protocol buffers.
 

Detailed Description

This class appends a protocol buffer to a file in a binary format. The data written in the file follows the following format (sequentially):

  • MagicNumber (32 bits) to recognize this format.
  • Uncompressed data payload size (64 bits).
  • Compressed data payload size (64 bits), or 0 if the data is not compressed.
  • Payload, possibly compressed. See RecordWriter::Compress() and RecordReader::Uncompress.

Definition at line 33 of file recordio.h.

Constructor & Destructor Documentation

◆ RecordWriter()

recordio::RecordWriter::RecordWriter ( File *const file)
explicit

Definition at line 26 of file recordio.cc.

Member Function Documentation

◆ Close()

bool recordio::RecordWriter::Close ( )

Closes the underlying file.

Definition at line 29 of file recordio.cc.

◆ set_use_compression()

void recordio::RecordWriter::set_use_compression ( bool use_compression)

Definition at line 31 of file recordio.cc.

◆ WriteProtocolMessage()

template<class P >
bool recordio::RecordWriter::WriteProtocolMessage ( const P & proto)
inline

Definition at line 41 of file recordio.h.

Member Data Documentation

◆ kMagicNumber

const int recordio::RecordWriter::kMagicNumber = 0x3ed7230a
static

Magic number when reading and writing protocol buffers.

Definition at line 36 of file recordio.h.


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