libpniio
attribute_utils.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2014 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. See 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: Jul 15, 2014
21 // Author: Eugen Wintersberger <eugen.wintersberger@desy.de>
22 //
23 
24 #pragma once
25 #include <vector>
26 
27 #include <pni/core/types.hpp>
28 
29 namespace pni{
30 namespace io{
31 namespace nx{
32 namespace h5{
33 
34  //forward declaration of object_imp
35  class object_imp;
36  class h5dataspace;
37  class h5datatype;
38 
39  //------------------------------------------------------------------------
54  bool has_attribute(const object_imp &parent,const pni::core::string &name);
55 
56  //------------------------------------------------------------------------
70  void delete_attribute(const object_imp &parent,const pni::core::string &name);
71 
72  //-------------------------------------------------------------------------
89  object_imp create_attribute(const object_imp &parent,
90  const pni::core::string &name,
91  const h5datatype &type,
92  const h5dataspace &space,
93  bool overwrite);
94 
95  //------------------------------------------------------------------------
112  object_imp get_attribute_by_name(const object_imp &parent,const pni::core::string &n);
113 
114 
115  //-----------------------------------------------------------------
128  size_t get_number_of_attributes(const object_imp &parent) ;
129 
130  //------------------------------------------------------------------------
147  object_imp get_attribute_by_index(const object_imp &parent,size_t i);
148 
149 
150 //end of namespace
151 }
152 }
153 }
154 }
object_imp get_attribute_by_name(const object_imp &parent, const pni::core::string &n)
open attribute by name
Definition: attribute_utils.cpp:108
size_t get_number_of_attributes(const object_imp &parent)
get number of attributes
Definition: attribute_utils.cpp:123
void delete_attribute(const object_imp &parent, const pni::core::string &name)
Deletes an attribute.
Definition: attribute_utils.cpp:59
Definition: cbf_reader.hpp:41
object_imp get_attribute_by_index(const object_imp &parent, size_t i)
open attribute by index
Definition: attribute_utils.cpp:140
bool has_attribute(const object_imp &parent, const pni::core::string &name)
checks for an attributes existence
Definition: attribute_utils.cpp:40
object_imp create_attribute(const object_imp &parent, const pni::core::string &name, const h5datatype &type, const h5dataspace &space, bool overwrite)
create a new attribute at parent
Definition: attribute_utils.cpp:77