Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
HAPI_HDFFile.cc
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9#include "HAPI.hpp"
10
11#ifdef HAPI_USE_HDF5
12namespace HAPI {
13
14/*
15=========================================================
16 *
17 * @return
18 */
19HDFFile::HDFFile() :
20 m_name( "" ),
21 m_doc( 0 ),
22 m_doc_as_node(nullptr){
23
24}
25/*
26=========================================================
27 *
28 * @param filename
29 * @return
30 */
31HDFFile::HDFFile(char const *filename) :
32 m_name( filename ) {
33
34 m_doc = H5Fopen( filename, H5F_ACC_RDONLY, H5P_DEFAULT );
35 m_doc_as_node = new HDFNode( m_doc );
36
37}
38/*
39=========================================================
40*/
41HDFFile::~HDFFile( ) {
42
43 H5Fclose(m_doc);
44 delete m_doc_as_node;
45
46}
47/*
48============================================================
49===================== get child element ====================
50============================================================
51 *
52 * @return
53 */
54Node HDFFile::child(char const *a_name) {
55
56 return Node( m_doc_as_node->child(a_name) );
57
58}
59/*
60============================================================
61===================== get first child node =================
62============================================================
63*/
64Node HDFFile::first_child() {
65
66 return Node( m_doc_as_node->first_child() );
67
68}
69/*
70=========================================================
71*/
72std::string HDFFile::name() const {
73
74 return m_name;
75
76}
77
78}
79#endif
Definition HAPI.hpp:34