SheafSystem  0.0.0.0
sheaf::attributes_record_set Class Reference

A record set for storing various poset attributes. More...

#include <attributes_record_set.h>

Inheritance diagram for sheaf::attributes_record_set:
sheaf::record_set sheaf::any

Public Member Functions

 attributes_record_set (const attributes_record_set &xother)
 Copy constructor. More...
 
virtual attributes_record_setclone () const
 Virtual constructor; makes a new instance of the same type as this. More...
 
virtual ~attributes_record_set ()
 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...
 
 attributes_record_set (const sheaf_file &xfile, const poset_scaffold &xscaffold)
 Creates an instance attached to the record_set with name xname in the file xfile, with a record buffer containing xbuffer_ub records. More...
 
virtual const std::string & suffix () const
 The name suffix for this data set. More...
 
void internalize ()
 Internalize the record set from disk. More...
 
void externalize ()
 Externalize the reccord set to disk. More...
 
- Public Member Functions inherited from sheaf::record_set
 record_set (const sheaf_file &xfile, int xrecord_buffer_ub, const poset_scaffold &xscaffold)
 Creates an instance attached to the record_set with name xname in the file xfile, using record packets of size xpacket_ub. More...
 
 record_set (const record_set &xother)
 Copy constructor. More...
 
virtual ~record_set ()
 Destructor. More...
 
const sheaf_filefile () const
 The file this record_set belongs to. More...
 
std::string name () const
 The name of this data set. More...
 
std::string alias () const
 The standard alias for this data set. More...
 
std::string data_set_name (const std::string &xname) const
 The data set name for a poset with name xname. More...
 
std::string data_set_alias (const std::string &xname) const
 The data set alias for a poset with name xname. More...
 
std::string poset_name () const
 The name of the poset this represents, extracted from the name of the dataset. More...
 
poset_scaffoldscaffold ()
 Scaffold for constructing poset associated with this record set (mutable version). More...
 
const poset_scaffoldscaffold () const
 Scaffold for constructing poset associated with this record set (const version). More...
 
poset_data_type_maptype_map ()
 Data type map for records in this record set (mutable version) More...
 
const poset_data_type_maptype_map () const
 Data type map for records in this record set (const version) More...
 
virtual void open ()
 Opens the record_set. More...
 
bool is_open () const
 True if this record_set is open. More...
 
virtual void close ()
 Closes the record_set. More...
 
int record_buffer_ct () const
 The number of active records in record buffer. More...
 
void inc_record_buffer_ct ()
 The increment the number of active records in record buffer. More...
 
void reset_record_buffer_ct ()
 The set the number of active records in record buffer to 0. More...
 
int record_buffer_ub () const
 The maximum number of records the buffer can hold. More...
 
bool record_buffer_is_empty () const
 True if there are no active records in the buffer. More...
 
bool record_buffer_is_full () const
 True if there are no inactive records in the buffer. 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...
 

Protected Member Functions

virtual hid_t create_dataset ()
 Creates the HDF dataset associated with this. More...
 
virtual void create_int_data_type ()
 Creates a new HDF internal data type. More...
 
virtual void read_dataset_attributes ()
 Reads the dataset attribute objects from the file. More...
 
virtual void write_dataset_attributes ()
 Writes the dataset attribute objects into the file. More...
 
virtual void read_toc_bounds_attribute ()
 Reads the table of contents lower bound attribute into the file. More...
 
virtual void write_toc_bounds_attribute ()
 Writes the table of contents lower bound attribute into the file. More...
 
- Protected Member Functions inherited from sheaf::record_set
void extend_dataset (const hsize_t *xdims, int xdims_ub)
 Extends the dataset dimensions to at least the dimensions given xdims, an array of length xdims_ub. More...
 
void create_alias ()
 Creates a soft link from alias to the data set. More...
 
void set_name_from_alias ()
 Sets the primary name of the dataset from the alias. More...
 
hid_t hdf_id ()
 The HDF id for this record set. More...
 
hid_t ext_dataspace_hdf_id ()
 The HDF id for the external dataspace of this record set. More...
 
hid_t ext_data_type_hdf_id ()
 The HDF external data type id for this record set. More...
 
int ext_dataspace_rank ()
 The rank of the dataspace for the record_set. More...
 
hsize_t ext_dataspace_dim (int xi)
 The dimension of xi-th index of the external dataspace. More...
 
hid_t int_dataspace_hdf_id ()
 The hdf5 id of the internal dataspace associated with the record buffer. More...
 
hid_t int_data_type_hdf_id ()
 The HDF internal data type id for this record set. More...
 
void read_attribute (const char *&xatt_values, size_type &xatt_ct, const data_converter *xatt_conv, const std::string &xatt_name)
 Reads the attribute with name xatt_name from the file. More...
 
void write_attribute (const void *xatt_values, size_type xatt_ct, const data_converter *xatt_conv, const std::string &xatt_name)
 Writes the attribute with name xatt_name into the file. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 

Static Protected Member Functions

static const char * TOC_BOUNDS_ATTRIBUTE_NAME ()
 The name of the table of contents lower bound attribute. More...
 

Static Protected Attributes

static const hsize_t TOC_BOUNDS_EXTENT = 3
 The extent of the table of contents lower bound attribute dataspace. More...
 
- Static Protected Attributes inherited from sheaf::record_set
static const hid_t NOT_AN_HDF_ID = -1
 Value indicating an invalid HDf object id. /. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sheaf::record_set
static const std::string & name_space_alias ()
 The reserved, standard alias for the namespace in the file. More...
 
static const std::string & name_space_prefix ()
 The reserved, standard prefix for namespace dataser names. More...
 
- Protected Attributes inherited from sheaf::record_set
sheaf_file_file
 The file this record_set belongs to. More...
 
std::string _name
 The name of this record_set. More...
 
std::string _alias
 The standard alias for this record_set. More...
 
poset_scaffold_scaffold
 The poset scaffold associated with this. More...
 
hid_t _hdf_id
 The HDF id for this record set. More...
 
hid_t _ext_dataspace_hdf_id
 The HDF id for the external dataspace of this record set. More...
 
hid_t _ext_data_type_hdf_id
 The HDF external data type id for this record set. More...
 
int _ext_dataspace_rank
 The rank of the dataspace for the record_set. More...
 
hsize_t * _ext_dataspace_dims
 The current dimensions of the external dataspace. More...
 
int _record_buffer_ct
 The number of active records in record buffer. More...
 
int _record_buffer_ub
 The maximum number of records the buffer can hold. More...
 
hid_t _int_dataspace_hdf_id
 The hdf5 id of the dataspace associated with the record buffer. More...
 
hid_t _int_data_type_hdf_id
 The HDF internal data type id for this record set. More...
 

Detailed Description

A record set for storing various poset attributes.

Definition at line 85 of file attributes_record_set.h.

Constructor & Destructor Documentation

◆ attributes_record_set() [1/2]

sheaf::attributes_record_set::attributes_record_set ( const attributes_record_set xother)

Copy constructor.

Not Implemented.

Postcondition

Definition at line 56 of file attributes_record_set.cc.

References clone(), and invariant().

Referenced by clone(), and is_ancestor_of().

◆ ~attributes_record_set()

sheaf::attributes_record_set::~attributes_record_set ( )
virtual

Destructor.

Definition at line 112 of file attributes_record_set.cc.

References sheaf::record_set::_ext_dataspace_dims, and invariant().

Referenced by clone().

◆ attributes_record_set() [2/2]

Member Function Documentation

◆ clone()

sheaf::attributes_record_set * sheaf::attributes_record_set::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::record_set.

Definition at line 89 of file attributes_record_set.cc.

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

Referenced by attributes_record_set().

◆ create_dataset()

hid_t sheaf::attributes_record_set::create_dataset ( )
protectedvirtual

Creates the HDF dataset associated with this.

Precondition
  • file().mode() == sheaf_file::READ_WRITE
Postcondition
  • result >= 0

Implements sheaf::record_set.

Definition at line 506 of file attributes_record_set.cc.

References sheaf::record_set::_ext_dataspace_hdf_id, sheaf::record_set::_int_data_type_hdf_id, create_int_data_type(), sheaf::record_set::file(), sheaf::record_set::hdf_id(), sheaf::record_set::name(), and sheaf::record_set::record_buffer_ub().

Referenced by externalize().

◆ create_int_data_type()

void sheaf::attributes_record_set::create_int_data_type ( )
protectedvirtual

◆ externalize()

void sheaf::attributes_record_set::externalize ( )

Externalize the reccord set to disk.

Precondition
  • scaffold().structure().state_is_read_accessible()

Definition at line 400 of file attributes_record_set.cc.

References sheaf::record_set::_record_buffer_ub, create_dataset(), sheaf::attributes_record::externalize(), and sheaf::record_set::scaffold().

Referenced by sheaf::storage_agent::commit_transaction(), and internalize().

◆ internalize()

void sheaf::attributes_record_set::internalize ( )

Internalize the record set from disk.

Precondition
  • !scaffold().structure().is_external() ? scaffold().structure().state_is_read_write_accessible() : true
Postcondition
  • !scaffold().structure().is_external()
  • scaffold().structure().state_is_read_write_accessible()

Definition at line 280 of file attributes_record_set.cc.

References sheaf::record_set::_int_data_type_hdf_id, sheaf::record_set::_int_dataspace_hdf_id, sheaf::record_set::_record_buffer_ub, externalize(), sheaf::attributes_record::internalize(), and sheaf::record_set::scaffold().

Referenced by sheaf::storage_agent::begin_read_transaction(), and suffix().

◆ invariant()

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

◆ is_ancestor_of()

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

Conformance test; true if other conforms to this.

Precondition
  • other != 0

Reimplemented from sheaf::record_set.

Definition at line 168 of file attributes_record_set.cc.

References attributes_record_set().

Referenced by invariant().

◆ read_dataset_attributes()

void sheaf::attributes_record_set::read_dataset_attributes ( )
protectedvirtual

Reads the dataset attribute objects from the file.

Precondition
Postcondition
  • -unexecutable( "all attributes opened, read, and closed" )

Reimplemented from sheaf::record_set.

Definition at line 656 of file attributes_record_set.cc.

References sheaf::record_set::is_open(), read_toc_bounds_attribute(), and write_dataset_attributes().

Referenced by create_int_data_type().

◆ read_toc_bounds_attribute()

◆ suffix()

const std::string & sheaf::attributes_record_set::suffix ( ) const
virtual

The name suffix for this data set.

Reimplemented from sheaf::record_set.

Definition at line 256 of file attributes_record_set.cc.

References internalize().

Referenced by attributes_record_set().

◆ TOC_BOUNDS_ATTRIBUTE_NAME()

const char * sheaf::attributes_record_set::TOC_BOUNDS_ATTRIBUTE_NAME ( )
staticprotected

The name of the table of contents lower bound attribute.

Definition at line 699 of file attributes_record_set.cc.

References read_toc_bounds_attribute(), and TOC_BOUNDS_EXTENT.

Referenced by read_toc_bounds_attribute(), write_dataset_attributes(), and write_toc_bounds_attribute().

◆ write_dataset_attributes()

void sheaf::attributes_record_set::write_dataset_attributes ( )
protectedvirtual

Writes the dataset attribute objects into the file.

Precondition
Postcondition
  • -unexecutable( "all attributes created, written, and closed" )

Reimplemented from sheaf::record_set.

Definition at line 678 of file attributes_record_set.cc.

References sheaf::record_set::is_open(), TOC_BOUNDS_ATTRIBUTE_NAME(), and write_toc_bounds_attribute().

Referenced by read_dataset_attributes().

◆ write_toc_bounds_attribute()

void sheaf::attributes_record_set::write_toc_bounds_attribute ( )
protectedvirtual

Writes the table of contents lower bound attribute into the file.

Precondition
Issue:
this won't be true when we replace HDF variable length data types with libSheaf variable length records.
Postcondition
  • -unexecutable( "all attributes created, written, and closed" )

Definition at line 816 of file attributes_record_set.cc.

References sheaf::record_set::_hdf_id, sheaf::record_set::is_open(), sheaf::is_valid(), sheaf::poset_bounds::lb_id(), sheaf::poset_scaffold::member_id_space(), sheaf::poset_state_handle::name(), sheaf::explicit_index_space_handle::pod(), sheaf::poset_scaffold::row_bounds(), sheaf::record_set::scaffold(), sheaf::poset_scaffold::structure(), sheaf::poset_scaffold::subposet_id_space(), TOC_BOUNDS_ATTRIBUTE_NAME(), TOC_BOUNDS_EXTENT, and sheaf::record_set::type_map().

Referenced by read_toc_bounds_attribute(), and write_dataset_attributes().

Member Data Documentation

◆ TOC_BOUNDS_EXTENT

const hsize_t sheaf::attributes_record_set::TOC_BOUNDS_EXTENT = 3
staticprotected

The extent of the table of contents lower bound attribute dataspace.

Definition at line 179 of file attributes_record_set.h.

Referenced by read_toc_bounds_attribute(), TOC_BOUNDS_ATTRIBUTE_NAME(), and write_toc_bounds_attribute().


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