NeighboursBinaryFileWriter Class Reference

Binary file writer for nearest neighbours results. More...

#include <NeighboursBinaryFileWriter.h>

Inheritance diagram for NeighboursBinaryFileWriter:
Inheritance graph
[legend]
Collaboration diagram for NeighboursBinaryFileWriter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NeighboursBinaryFileWriter (char const *aFileNameStr, bool aIsLarge=false)
 Constructor.
virtual ~NeighboursBinaryFileWriter ()
virtual void open ()
 Open file for writing.
virtual void close ()
 Close file.
virtual void write (Object const *aMasterObjectPtr, Object const *aSlaveObjectPtr)
 Write an object pair record to the output binary file.

Protected Attributes

union {
   char   bytes [mcRecordSize]
   struct {
      long long   masterObjId
      long long   slaveObjId
      float   distanceMins
   }   field
mRecord
 Record data structure definition.
FILE * mFilePtr
char const * mFileNameStr
bool mIsLarge

Static Protected Attributes

static const unsigned mcRecordSize = 20
 Size of a record in bytes.

Private Member Functions

 NeighboursBinaryFileWriter ()
 NeighboursBinaryFileWriter (NeighboursBinaryFileWriter const &aCopy)
NeighboursBinaryFileWriteroperator= (NeighboursBinaryFileWriter const &aCopy)

Detailed Description

Binary file writer for nearest neighbours results.

Creates binary file consisting of records for each matching pair, including reverse matches, with fields: masterObjId (8 byte long long), slaveObjId (8 byte long long), distanceMins (the source separation in arcminutes, 4 byte float)

Definition at line 24 of file NeighboursBinaryFileWriter.h.


Constructor & Destructor Documentation

NeighboursBinaryFileWriter::NeighboursBinaryFileWriter ( char const *  aFileNameStr,
bool  aIsLarge = false 
)

Constructor.

Parameters:
aFileNameStr Create output file with this name
aIsLarge Will file be larger than 2 Gb?

Definition at line 13 of file NeighboursBinaryFileWriter.cpp.

virtual NeighboursBinaryFileWriter::~NeighboursBinaryFileWriter (  )  [inline, virtual]

Definition at line 33 of file NeighboursBinaryFileWriter.h.

NeighboursBinaryFileWriter::NeighboursBinaryFileWriter (  )  [private]
NeighboursBinaryFileWriter::NeighboursBinaryFileWriter ( NeighboursBinaryFileWriter const &  aCopy  )  [private]

Member Function Documentation

void NeighboursBinaryFileWriter::close (  )  [virtual]

Close file.

Reimplemented from ObjectPairWriter.

Definition at line 27 of file NeighboursBinaryFileWriter.cpp.

References FileUtil::close(), FileUtil::instance(), and mFilePtr.

void NeighboursBinaryFileWriter::open (  )  [virtual]

Open file for writing.

Reimplemented from ObjectPairWriter.

Definition at line 22 of file NeighboursBinaryFileWriter.cpp.

References FileUtil::instance(), mFileNameStr, mFilePtr, mIsLarge, and FileUtil::writeOpen().

NeighboursBinaryFileWriter& NeighboursBinaryFileWriter::operator= ( NeighboursBinaryFileWriter const &  aCopy  )  [private]
virtual void NeighboursBinaryFileWriter::write ( Object const *  aMasterObjectPtr,
Object const *  aSlaveObjectPtr 
) [inline, virtual]

Write an object pair record to the output binary file.

Parameters:
aMasterObjectPtr Datum Object for the first source in the pair
aSlaveObjectPtr Datum Object for the second source in the pair

Reimplemented from ObjectPairWriter.

Definition at line 45 of file NeighboursBinaryFileWriter.h.

References Datum::getId(), mcRecordSize, mFilePtr, and mRecord.


Member Data Documentation

Definition at line 67 of file NeighboursBinaryFileWriter.h.

Definition at line 71 of file NeighboursBinaryFileWriter.h.

Definition at line 69 of file NeighboursBinaryFileWriter.h.

const unsigned NeighboursBinaryFileWriter::mcRecordSize = 20 [static, protected]

Size of a record in bytes.

Definition at line 63 of file NeighboursBinaryFileWriter.h.

Referenced by write().

Definition at line 76 of file NeighboursBinaryFileWriter.h.

Referenced by open().

Definition at line 75 of file NeighboursBinaryFileWriter.h.

Referenced by close(), open(), and write().

Definition at line 77 of file NeighboursBinaryFileWriter.h.

Referenced by open().

union { ... } NeighboursBinaryFileWriter::mRecord [protected]

Record data structure definition.

Referenced by write().

Definition at line 70 of file NeighboursBinaryFileWriter.h.


The documentation for this class was generated from the following files:
Generated on Mon Oct 4 10:40:33 2010 for Matching.kdevelop by  doxygen 1.6.3