SheafSystem  0.0.0.0
sheaf::sheaf_file Class Reference

An encapsulation of an HDF file containing sheaf data. More...

#include <sheaf_file.h>

Inheritance diagram for sheaf::sheaf_file:
sheaf::any

Public Types

enum  access_mode { NONE, READ_ONLY, READ_WRITE }
 File access modes. More...
 

Public Member Functions

 sheaf_file ()
 Default constructor. More...
 
 sheaf_file (const sheaf_file &xother)
 Copy constructor. More...
 
virtual sheaf_fileclone () const
 Virtual constructor; makes a new instance of the same type as this. More...
 
virtual ~sheaf_file ()
 Destructor. More...
 
virtual bool invariant () const
 Class invariant. More...
 
virtual bool is_ancestor_of (const any *other) const
 Conformance test; true if other conforms to this. More...
 
std::string name () const
 The name of this file. More...
 
void open (const std::string &xname, access_mode xmode=READ_WRITE, bool xclobber=true)
 Opens a file with name xname, with access mode xmode. If xclobber and the file already exists, delete it first. More...
 
bool is_open () const
 True if this file is open. More...
 
access_mode mode () const
 The current access mode. More...
 
void close ()
 Closes the file. More...
 
data_type_maptype_map ()
 Data type map for primitive types in this file (mutable version) More...
 
const data_type_maptype_map () const
 Data type map for primitive types in this file (const version) More...
 
bool type_map_defined () const
 True if type map previously defined. More...
 
- Public Member Functions inherited from sheaf::any
bool is_same_type (const any *other) const
 True if other is the same type as this. More...
 
virtual ~any ()
 Destructor. More...
 
bool invariant_check () const
 True if invariant checking is enabled. More...
 
void enable_invariant_check () const
 Enable invariant checking. More...
 
void disable_invariant_check () const
 Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing invariant checking during multi-phase initialization. More...
 
int disable_invariance_check_request_depth () const
 Number of times disable_invariant_check has been called without matching call to enable_invariant_check. More...
 

Friends

class data_type_map
 
class record_set
 
class attributes_record_set
 
class member_record_set
 
class dof_tuple_record_set
 

Additional Inherited Members

- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 

Detailed Description

An encapsulation of an HDF file containing sheaf data.

Definition at line 49 of file sheaf_file.h.

Member Enumeration Documentation

◆ access_mode

File access modes.

Definition at line 111 of file sheaf_file.h.

Constructor & Destructor Documentation

◆ sheaf_file() [1/2]

sheaf::sheaf_file::sheaf_file ( )

Default constructor.

Postcondition

Definition at line 43 of file sheaf_file.cc.

References invariant().

Referenced by clone().

◆ sheaf_file() [2/2]

sheaf::sheaf_file::sheaf_file ( const sheaf_file xother)

Copy constructor.

Postcondition

Definition at line 70 of file sheaf_file.cc.

References clone(), and invariant().

◆ ~sheaf_file()

sheaf::sheaf_file::~sheaf_file ( )
virtual

Destructor.

Definition at line 116 of file sheaf_file.cc.

References invariant().

Referenced by clone().

Member Function Documentation

◆ clone()

sheaf::sheaf_file * sheaf::sheaf_file::clone ( ) const
virtual

Virtual constructor; makes a new instance of the same type as this.

Postcondition
  • result != 0
  • is_same_type(result)

Reimplemented from sheaf::any.

Definition at line 92 of file sheaf_file.cc.

References sheaf::any::is_same_type(), sheaf_file(), and ~sheaf_file().

Referenced by sheaf_file().

◆ close()

void sheaf::sheaf_file::close ( )

Closes the file.

Precondition
Postcondition
  • !is_open()

Definition at line 351 of file sheaf_file.cc.

References is_open(), and type_map().

Referenced by mode().

◆ invariant()

bool sheaf::sheaf_file::invariant ( ) const
virtual

◆ is_ancestor_of()

bool sheaf::sheaf_file::is_ancestor_of ( const any other) const
virtual

Conformance test; true if other conforms to this.

Precondition
  • other != 0

Reimplemented from sheaf::any.

Definition at line 174 of file sheaf_file.cc.

References open().

Referenced by invariant().

◆ is_open()

bool sheaf::sheaf_file::is_open ( ) const

◆ mode()

sheaf::sheaf_file::access_mode sheaf::sheaf_file::mode ( ) const

The current access mode.

Definition at line 330 of file sheaf_file.cc.

References close().

Referenced by is_open(), open(), and sheaf::record_set::open().

◆ name()

std::string sheaf::sheaf_file::name ( ) const
inline

The name of this file.

Definition at line 103 of file sheaf_file.h.

Referenced by open().

◆ open()

void sheaf::sheaf_file::open ( const std::string &  xname,
access_mode  xmode = READ_WRITE,
bool  xclobber = true 
)

Opens a file with name xname, with access mode xmode. If xclobber and the file already exists, delete it first.

Precondition
  • !is_open()
  • !xname.empty()
Postcondition

Definition at line 201 of file sheaf_file.cc.

References invariant(), is_open(), mode(), and name().

Referenced by is_ancestor_of().

◆ type_map() [1/2]

sheaf::data_type_map & sheaf::sheaf_file::type_map ( )

Data type map for primitive types in this file (mutable version)

Precondition

Definition at line 393 of file sheaf_file.cc.

References is_open().

Referenced by close().

◆ type_map() [2/2]

const sheaf::data_type_map & sheaf::sheaf_file::type_map ( ) const

Data type map for primitive types in this file (const version)

Precondition

Definition at line 413 of file sheaf_file.cc.

References is_open(), and type_map_defined().

◆ type_map_defined()

bool sheaf::sheaf_file::type_map_defined ( ) const

True if type map previously defined.

Definition at line 436 of file sheaf_file.cc.

References is_open().

Referenced by invariant(), and type_map().


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