hops
H5Annotate_traits.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c), 2017, Adrien Devresse <adrien.devresse@epfl.ch>
3  *
4  * Distributed under the Boost Software License, Version 1.0.
5  * (See accompanying file LICENSE_1_0.txt or copy at
6  * http://www.boost.org/LICENSE_1_0.txt)
7  *
8  */
9 #ifndef H5ANNOTATE_TRAITS_HPP
10 #define H5ANNOTATE_TRAITS_HPP
11 
12 #include <string>
13 
14 #include "../H5Attribute.hpp"
15 
16 namespace HighFive {
17 
18 template <typename Derivate>
19 class AnnotateTraits {
20  public:
28  Attribute createAttribute(const std::string& attribute_name,
29  const DataSpace& space,
30  const DataType& type);
31 
39  template <typename Type>
40  Attribute createAttribute(const std::string& attribute_name,
41  const DataSpace& space);
42 
51  template <typename T>
52  Attribute createAttribute(const std::string& attribute_name,
53  const T& data);
54 
58  void deleteAttribute(const std::string& attribute_name);
59 
64  Attribute getAttribute(const std::string& attribute_name) const;
65 
69  size_t getNumberAttributes() const;
70 
74  std::vector<std::string> listAttributeNames() const;
75 
79  bool hasAttribute(const std::string& attr_name) const;
80 
81  private:
82  typedef Derivate derivate_type;
83 };
84 }
85 
86 
87 #endif // H5ANNOTATE_TRAITS_HPP
HighFive::AnnotateTraits::getNumberAttributes
size_t getNumberAttributes() const
return the number of attributes of the node / group
Definition: H5Annotate_traits_misc.hpp:82
HighFive::AnnotateTraits::createAttribute
Attribute createAttribute(const std::string &attribute_name, const DataSpace &space, const DataType &type)
create a new attribute with the name attribute_name
Definition: H5Annotate_traits_misc.hpp:25
HighFive::AnnotateTraits::hasAttribute
bool hasAttribute(const std::string &attr_name) const
checks an attribute exists
Definition: H5Annotate_traits_misc.hpp:114
HighFive::AnnotateTraits::deleteAttribute
void deleteAttribute(const std::string &attribute_name)
deleteAttribute let you delete an attribute by its name.
Definition: H5Annotate_traits_misc.hpp:61
HighFive::ObjectType::Attribute
@ Attribute
HighFive::AnnotateTraits::listAttributeNames
std::vector< std::string > listAttributeNames() const
list all attribute name of the node / group
Definition: H5Annotate_traits_misc.hpp:93
HighFive::AnnotateTraits::getAttribute
Attribute getAttribute(const std::string &attribute_name) const
open an existing attribute with the name attribute_name
Definition: H5Annotate_traits_misc.hpp:69
string
NAME string(REPLACE ".cpp" "_bin" example_name ${example_filename}) if($
Definition: hops/Third-party/HighFive/src/examples/CMakeLists.txt:6
HighFive
Definition: H5_definitions.hpp:15