Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
Nektar::LibUtilities::H5::File Class Reference

HDF5 file wrapper. More...

#include <H5.h>

Inheritance diagram for Nektar::LibUtilities::H5::File:
Inheritance graph
[legend]
Collaboration diagram for Nektar::LibUtilities::H5::File:
Collaboration graph
[legend]

Public Member Functions

 ~File ()
 
void Close ()
 
virtual hsize_t GetNumElements ()
 
- Public Member Functions inherited from Nektar::LibUtilities::H5::CanHaveGroupsDataSets
GroupSharedPtr CreateGroup (const std::string &name, PListSharedPtr createPL=PList::Default(), PListSharedPtr accessPL=PList::Default())
 
DataSetSharedPtr CreateDataSet (const std::string &name, DataTypeSharedPtr type, DataSpaceSharedPtr space, PListSharedPtr createPL=PList::Default(), PListSharedPtr accessPL=PList::Default())
 
template<class T >
DataSetSharedPtr CreateWriteDataSet (const std::string &name, const std::vector< T > &data, PListSharedPtr createPL=PList::Default(), PListSharedPtr accessPL=PList::Default())
 
GroupSharedPtr OpenGroup (const std::string &name, PListSharedPtr accessPL=PList::Default()) const
 
DataSetSharedPtr OpenDataSet (const std::string &name, PListSharedPtr accessPL=PList::Default()) const
 
LinkIterator begin ()
 
LinkIterator end ()
 
- Public Member Functions inherited from Nektar::LibUtilities::H5::Object
hid_t GetId () const
 
 operator hid_t () const
 

Static Public Member Functions

static FileSharedPtr Create (const std::string &filename, unsigned mode, PListSharedPtr createPL=PList::Default(), PListSharedPtr accessPL=PList::Default())
 
static FileSharedPtr Open (const std::string &filename, unsigned mode, PListSharedPtr accessPL=PList::Default())
 

Private Member Functions

 File (hid_t id)
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::LibUtilities::H5::Object
 Object ()
 
 Object (hid_t id)
 
virtual ~Object ()
 
- Protected Attributes inherited from Nektar::LibUtilities::H5::Object
hid_t m_Id
 

Detailed Description

HDF5 file wrapper.

Definition at line 422 of file H5.h.

Constructor & Destructor Documentation

Nektar::LibUtilities::H5::File::~File ( )

Definition at line 571 of file H5.cpp.

References Close().

572 {
573  Close();
574 }
Nektar::LibUtilities::H5::File::File ( hid_t  id)
private

Definition at line 552 of file H5.cpp.

Referenced by Create(), and Open().

552  : Object(id)
553 {
554 }

Member Function Documentation

void Nektar::LibUtilities::H5::File::Close ( )
virtual

Implements Nektar::LibUtilities::H5::Object.

Definition at line 576 of file H5.cpp.

References H5_CALL.

Referenced by ~File().

577 {
578  H5_CALL(H5Fclose, (m_Id));
579  m_Id = H5I_INVALID_HID;
580 }
#define H5_CALL(func, args)
Definition: H5.h:68
FileSharedPtr Nektar::LibUtilities::H5::File::Create ( const std::string &  filename,
unsigned  mode,
PListSharedPtr  createPL = PList::Default(),
PListSharedPtr  accessPL = PList::Default() 
)
static

Definition at line 555 of file H5.cpp.

References File(), and H5_CONSTRUCT.

Referenced by Nektar::LibUtilities::FieldIOHdf5::v_Write().

557 {
558  hid_t id;
559  H5_CONSTRUCT(id, H5Fcreate, (filename.c_str(), mode, createPL->GetId(),
560  accessPL->GetId()));
561  return FileSharedPtr(new File(id));
562 }
#define H5_CONSTRUCT(ans, func, args)
Definition: H5.h:57
boost::shared_ptr< File > FileSharedPtr
Definition: H5.h:98
hsize_t Nektar::LibUtilities::H5::File::GetNumElements ( )
virtual

Implements Nektar::LibUtilities::H5::CanHaveGroupsDataSets.

Definition at line 581 of file H5.cpp.

References Nektar::LibUtilities::H5::CanHaveGroupsDataSets::OpenGroup().

582 {
583  GroupSharedPtr root = OpenGroup("/");
584  return root->GetNumElements();
585 }
boost::shared_ptr< Group > GroupSharedPtr
Definition: FieldIOHdf5.h:50
GroupSharedPtr OpenGroup(const std::string &name, PListSharedPtr accessPL=PList::Default()) const
Definition: H5.cpp:246
FileSharedPtr Nektar::LibUtilities::H5::File::Open ( const std::string &  filename,
unsigned  mode,
PListSharedPtr  accessPL = PList::Default() 
)
static

Definition at line 563 of file H5.cpp.

References File(), and H5_CONSTRUCT.

Referenced by Nektar::LibUtilities::FieldIOHdf5::v_Write().

565 {
566  hid_t id;
567  H5_CONSTRUCT(id, H5Fopen, (filename.c_str(), mode, accessPL->GetId()));
568  return FileSharedPtr(new File(id));
569 }
#define H5_CONSTRUCT(ans, func, args)
Definition: H5.h:57
boost::shared_ptr< File > FileSharedPtr
Definition: H5.h:98