ReFRACtor
FullPhysics::HdfFileGenerating Class Reference

To avoid creating files when an error occurs, we create the file with the name ".generating" appended. More...

#include <hdf_file_generating.h>

+ Inheritance diagram for FullPhysics::HdfFileGenerating:
+ Collaboration diagram for FullPhysics::HdfFileGenerating:

Public Member Functions

 HdfFileGenerating (const std::string &Fname)
 Create a HDF file with the given name. More...
 
virtual ~HdfFileGenerating ()
 
void abandon ()
 Abandon a file and clean it up. More...
 
void close ()
 Close a file, changing the name to the final name. More...
 
HdfFilehdf_file ()
 
void print (std::ostream &Os) const
 
std::string print_to_string () const
 Print to string. More...
 

Detailed Description

To avoid creating files when an error occurs, we create the file with the name ".generating" appended.

Only after the file has been fully rewritten to we rename it without the ".generating" extension added.

This class handles this bit of logic.

Definition at line 16 of file hdf_file_generating.h.

Constructor & Destructor Documentation

◆ HdfFileGenerating()

FullPhysics::HdfFileGenerating::HdfFileGenerating ( const std::string &  Fname)
inline

Create a HDF file with the given name.

This should not have the ".generating" added, we add this in this class.

Definition at line 23 of file hdf_file_generating.h.

◆ ~HdfFileGenerating()

virtual FullPhysics::HdfFileGenerating::~HdfFileGenerating ( )
inlinevirtual

Definition at line 24 of file hdf_file_generating.h.

Member Function Documentation

◆ abandon()

void HdfFileGenerating::abandon ( )

Abandon a file and clean it up.

This would normally be called if an error condition occurs and we can't finish creating the file.

Definition at line 40 of file hdf_file_generating.cc.

◆ close()

void HdfFileGenerating::close ( )

Close a file, changing the name to the final name.

This is automatically called by the destructor, so you don't need to call this directly.

Definition at line 11 of file hdf_file_generating.cc.

◆ hdf_file()

HdfFile & HdfFileGenerating::hdf_file ( )

Definition at line 23 of file hdf_file_generating.cc.

◆ print()

void HdfFileGenerating::print ( std::ostream &  Os) const

Definition at line 55 of file hdf_file_generating.cc.

◆ print_to_string()

std::string FullPhysics::Printable< HdfFileGenerating >::print_to_string ( ) const
inlineinherited

Print to string.

This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.

Definition at line 31 of file printable.h.


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

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:12