Vector::BLF::File(3Vector)

NAME
Vector::BLF::File

SYNOPSIS

#include <File.h>

  Public Member Functions
virtual void open (const char *filename, const std::ios_base::openmode mode=std::ios_base::in)
virtual void open (const std::string &filename, const std::ios_base::openmode mode=std::ios_base::in)
virtual bool is_open () const
virtual bool good () const
virtual bool eof () const
virtual ObjectHeaderBase * read ()
virtual void write (ObjectHeaderBase *ohb)
virtual void close ()
virtual uint32_t defaultLogContainerSize () const
virtual void setDefaultLogContainerSize (uint32_t defaultLogContainerSize)

  Static Public Member Functions
static ObjectHeaderBase * createObject (ObjectType type)

  Public Attributes
FileStatistics fileStatistics {}
uint64_t currentUncompressedFileSize {}
std::atomic< uint32_t > currentObjectCount {}
int compressionLevel {1}
bool writeRestorePoints {true}

Detailed Description

File

This is similar to std::fstream for BLFs

Member Function Documentation

  void Vector::BLF::File::close () [virtual]
close file

  ObjectHeaderBase * Vector::BLF::File::createObject (ObjectType type) [static]
create object of given type

Parameters
    type object type

Returns
    new object

  uint32_t Vector::BLF::File::defaultLogContainerSize () const [virtual]
Get default log container size.

Returns
    default log container size

  bool Vector::BLF::File::eof () const [virtual]
Check whether eofbit is set.

Returns
    true if end-of-file reached

  bool Vector::BLF::File::good () const [virtual]
Check whether state of stream is good.

Returns
    true if no error flags set

  bool Vector::BLF::File::is_open () const [virtual]
is file open?

Returns
    true if file is open

  void Vector::BLF::File::open (const char * filename, const std::ios_base::openmode mode = std::ios_base::in) [virtual]
open file

Parameters
    filename file name
    mode open mode, either in (read) or out (write)

  void Vector::BLF::File::open (const std::string & filename, const std::ios_base::openmode mode = std::ios_base::in) [virtual]
open file

Parameters
    filename file name
    mode open mode, either in (read) or out (write)

  ObjectHeaderBase * Vector::BLF::File::read () [virtual]
Read object from file.

Ownership is taken over from the library to the user. The user has to take care to delete the object.

Todo
    Use std::unique_ptr in future versions.

Returns
    read object or nullptr

  void Vector::BLF::File::setDefaultLogContainerSize (uint32_t defaultLogContainerSize) [virtual]
Set default log container size.

Parameters
    defaultLogContainerSize default log container size

  void Vector::BLF::File::write (ObjectHeaderBase * ohb) [virtual]
Write object to file.

Ownership is taken over from the user to the library. The object should not be further accessed any more.

Todo
    Use std::unique_ptr in future versions.

Parameters
    ohb write object

Member Data Documentation

  int Vector::BLF::File::compressionLevel {1}
compression level

zlib compression levels:

•   0: Z_NO_COMPRESSION

•   1: Z_BEST_SPEED

•   9: Z_BEST_COMPRESSION

Vector BLF compression levels:

•   0: no compression

•   6: default compression

•   10: maximum compression

  std::atomic<uint32_t> Vector::BLF::File::currentObjectCount {}
Current number of objects read

Unknown115 is not counted.

  uint64_t Vector::BLF::File::currentUncompressedFileSize {}
Current uncompressed file size

This includes the LogContainer headers, and the uncompressed content.

  FileStatistics Vector::BLF::File::fileStatistics {}
File statistics from file header. contains total counts/sizes

  bool Vector::BLF::File::writeRestorePoints {true}
Write restore points at file close.

Author

Generated automatically by Doxygen for Vector BLF from the source code.