libpniio
h5link.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2012 DESY, Eugen Wintersberger <eugen.wintersberger@desy.de>
3 //
4 // This file is part of libpniio.
5 //
6 // libpniio is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // libpniio is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ee the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with libpniio. If not, see <http://www.gnu.org/licenses/>.
18 // ===========================================================================
19 //
20 // Created on: Feb 10, 2012
21 // Author: Eugen Wintersberger <eugen.wintersberger@desy.de>
22 //
23 
24 #pragma once
25 
26 extern "C"{
27 #include <hdf5.h>
28 }
29 
30 #include <pni/core/types.hpp>
31 #include <pni/core/error.hpp>
32 
33 #include "../nxlink_type.hpp"
34 #include "../nxpath/nxpath.hpp"
35 
36 namespace pni{
37 namespace io {
38 namespace nx{
39 namespace h5{
40 
41  class group_imp;
42 
49  class h5link
50  {
51  private:
66  static pni::core::string _nx2hdf5path(const nxpath &p);
67 
68  //----------------------------------------------------------------
82  static void check_if_valid(const group_imp &loc,
83  const pni::core::exception_record &record,
84  const pni::core::string &message);
85 
86  //----------------------------------------------------------------
102  static void check_if_exists(const group_imp &loc,
103  const pni::core::string &lname,
104  const pni::core::exception_record
105  &record,
106  const pni::core::string &message="");
107 
108  //----------------------------------------------------------------
126  static void check_if_exists(const group_imp &loc,size_t index,
127  const pni::core::exception_record
128  &record,
129  const pni::core::string &message="");
130 
131 
132  //----------------------------------------------------------------
147  static H5L_info_t get_link_info(const group_imp &loc,
148  const pni::core::string &name);
149 
150  //----------------------------------------------------------------
166  static H5L_info_t get_link_info(const group_imp &loc,
167  size_t index);
168 
169  //----------------------------------------------------------------
183  static auto get_link_value(const group_imp &loc,const
184  pni::core::string &lname)
185  -> pni::core::string;
186 
187 
188  //----------------------------------------------------------------
204  static auto get_external_link_target(const group_imp &loc,
205  const pni::core::string &lname)
207 
208  //----------------------------------------------------------------
224  static auto get_soft_link_target(const group_imp &loc,
225  const pni::core::string &lname)
227 
228  public:
229 
244  static auto link_name(const group_imp &loc,size_t index)
245  -> pni::core::string;
246 
247  //----------------------------------------------------------------
263  static auto link_target(const group_imp &loc,size_t index)
265 
266  //----------------------------------------------------------------
282  static auto link_target(const group_imp &loc,
283  const pni::core::string &name)
285 
286  //----------------------------------------------------------------
306  static void create_external_link(const nxpath &target,
307  const group_imp &loc,
308  const pni::core::string &name);
309 
310  //-----------------------------------------------------------------
330  static void create_internal_link(const nxpath &target,
331  const group_imp &loc,
332  const pni::core::string &name);
333 
334  //-----------------------------------------------------------------
350  static auto link_type(const group_imp &loc,
351  const pni::core::string &name)
353 
354  };
355 //end of namespace
356 }
357 }
358 }
359 }
nxlink_type
Nexus link type.
Definition: nxlink_type.hpp:51
HDF5 group object.
Definition: group_imp.hpp:47
Definition: cbf_reader.hpp:41
Nexus path class.
Definition: nxpath/nxpath.hpp:60