icedb  version 0.5.1
Snow particle scattering database API
Public Member Functions | Private Attributes | List of all members
icedb::Databases::file_image Class Reference

#include <Database_impl.hpp>

Collaboration diagram for icedb::Databases::file_image:
Collaboration graph
[legend]

Public Member Functions

std::shared_ptr< H5::H5File > getHFile () const
 
 file_image (const std::string &filename, size_t desiredSizeInBytes)
 
 ~file_image ()
 

Private Attributes

hid_t propertyList
 
std::vector< char > buffer
 
const std::string filename
 
std::shared_ptr< H5::H5File > hFile
 

Detailed Description

Definition at line 7 of file Database_impl.hpp.

Constructor & Destructor Documentation

◆ file_image()

icedb::Databases::file_image::file_image ( const std::string &  filename,
size_t  desiredSizeInBytes 
)

Definition at line 17 of file databases.cpp.

References buffer, hFile, and propertyList.

19  : buffer(desiredSizeInBytes), filename(filename),
20  propertyList(-1), hFile(nullptr)
21  {
22  propertyList = H5Pcreate(H5P_FILE_ACCESS);
23  const auto h5Result = H5Pset_fapl_core(propertyList, buffer.size(), false);
24  Expects(h5Result >= 0 && "H5Pset_fapl_core failed");
25  // This new memory-only dataset needs to always be writable. The flags parameter
26  // has little meaning in this context.
27  hFile = std::make_shared<H5::H5File>(filename.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, propertyList);
28  //m_file = H5Fcreate(filename.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, propertyList);
29  }
std::shared_ptr< H5::H5File > hFile
std::vector< char > buffer

◆ ~file_image()

icedb::Databases::file_image::~file_image ( )

Definition at line 30 of file databases.cpp.

References propertyList.

30  {
31  if (propertyList != -1) H5Pclose(propertyList);
32  }

Member Function Documentation

◆ getHFile()

std::shared_ptr< H5::H5File > icedb::Databases::file_image::getHFile ( ) const

Definition at line 16 of file databases.cpp.

References hFile.

16 { return hFile; }
std::shared_ptr< H5::H5File > hFile

Member Data Documentation

◆ buffer

std::vector<char> icedb::Databases::file_image::buffer
private

Definition at line 9 of file Database_impl.hpp.

Referenced by file_image().

◆ filename

const std::string icedb::Databases::file_image::filename
private

Definition at line 10 of file Database_impl.hpp.

◆ hFile

std::shared_ptr<H5::H5File> icedb::Databases::file_image::hFile
private

◆ propertyList

hid_t icedb::Databases::file_image::propertyList
private

Definition at line 8 of file Database_impl.hpp.

Referenced by file_image(), and ~file_image().


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