QMCPACK
HDFVersion Struct Reference
+ Collaboration diagram for HDFVersion:

Public Types

enum  { MAJOR = 0, MINOR }
 
using data_type = TinyVector< int, 2 >
 

Public Member Functions

 HDFVersion ()
 
 HDFVersion (int m, int n)
 
int operator[] (int i) const
 
int & operator[] (int i)
 
bool operator== (const HDFVersion &other) const
 
bool operator!= (const HDFVersion &other) const
 
int serialized () const
 limited to 100 for each version field More...
 
bool operator>= (const HDFVersion &other) const
 
bool operator< (const HDFVersion &other) const
 
bool read (data_type &ref, hid_t grp, const std::string &aname, hid_t xfer_plist=H5P_DEFAULT)
 
bool write (const data_type &ref, hid_t grp, const std::string &aname, hid_t xfer_plist=H5P_DEFAULT)
 

Public Attributes

data_type version
 

Detailed Description

Definition at line 51 of file HDFVersion.h.

Member Typedef Documentation

◆ data_type

using data_type = TinyVector<int, 2>

Definition at line 59 of file HDFVersion.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAJOR 
MINOR 

Definition at line 54 of file HDFVersion.h.

Constructor & Destructor Documentation

◆ HDFVersion() [1/2]

HDFVersion ( )
inline

Definition at line 62 of file HDFVersion.h.

62 : version(QMCPACK_VERSION_MAJOR, QMCPACK_VERSION_MINOR) {}

◆ HDFVersion() [2/2]

HDFVersion ( int  m,
int  n 
)
inlineexplicit

Definition at line 64 of file HDFVersion.h.

Member Function Documentation

◆ operator!=()

bool operator!= ( const HDFVersion other) const
inline

Definition at line 76 of file HDFVersion.h.

References HDFVersion::version.

77  {
78  return (version[0] != other.version[0] || version[1] != other.version[1]);
79  }

◆ operator<()

bool operator< ( const HDFVersion other) const
inline

Definition at line 86 of file HDFVersion.h.

References HDFVersion::serialized().

86 { return serialized() < other.serialized(); }
int serialized() const
limited to 100 for each version field
Definition: HDFVersion.h:82

◆ operator==()

bool operator== ( const HDFVersion other) const
inline

Definition at line 71 of file HDFVersion.h.

References HDFVersion::version.

72  {
73  return (version[0] == other.version[0] && version[1] == other.version[1]);
74  }

◆ operator>=()

bool operator>= ( const HDFVersion other) const
inline

Definition at line 84 of file HDFVersion.h.

References HDFVersion::serialized().

84 { return serialized() >= other.serialized(); }
int serialized() const
limited to 100 for each version field
Definition: HDFVersion.h:82

◆ operator[]() [1/2]

int operator[] ( int  i) const
inline

Definition at line 66 of file HDFVersion.h.

References HDFVersion::version.

66 { return version[i]; }

◆ operator[]() [2/2]

int& operator[] ( int  i)
inline

Definition at line 68 of file HDFVersion.h.

References HDFVersion::version.

68 { return version[i]; }

◆ read()

bool read ( data_type ref,
hid_t  grp,
const std::string &  aname,
hid_t  xfer_plist = H5P_DEFAULT 
)
inline

Definition at line 88 of file HDFVersion.h.

References h5data_proxy< T >::read(), and HDFVersion::version.

89  {
90  h5data_proxy<data_type> vin(version);
91  return vin.read(version, grp, aname, xfer_plist);
92  }

◆ serialized()

int serialized ( ) const
inline

limited to 100 for each version field

Definition at line 82 of file HDFVersion.h.

References HDFVersion::version.

Referenced by HDFVersion::operator<(), and HDFVersion::operator>=().

82 { return version[0] * 100 + version[1]; }

◆ write()

bool write ( const data_type ref,
hid_t  grp,
const std::string &  aname,
hid_t  xfer_plist = H5P_DEFAULT 
)
inline

Definition at line 94 of file HDFVersion.h.

References HDFVersion::version, and h5data_proxy< T >::write().

95  {
96  h5data_proxy<data_type> vout(version);
97  return vout.write(version, grp, aname, xfer_plist);
98  }

Member Data Documentation

◆ version


The documentation for this struct was generated from the following file: