![]() |
|
|||
File indexing completed on 2025-04-19 08:55:32
0001 /* 0002 * Copyright (c), 2017, Adrien Devresse <adrien.devresse@epfl.ch> 0003 * 0004 * Distributed under the Boost Software License, Version 1.0. 0005 * (See accompanying file LICENSE_1_0.txt or copy at 0006 * http://www.boost.org/LICENSE_1_0.txt) 0007 * 0008 */ 0009 #pragma once 0010 0011 #include <string> 0012 0013 #include "../H5Attribute.hpp" 0014 0015 namespace HighFive { 0016 0017 template <typename Derivate> 0018 class AnnotateTraits { 0019 public: 0020 /// 0021 /// \brief create a new attribute with the name attribute_name 0022 /// \param attribute_name identifier of the attribute 0023 /// \param space Associated \ref DataSpace 0024 /// \param type 0025 /// \return the attribute object 0026 /// 0027 Attribute createAttribute(const std::string& attribute_name, 0028 const DataSpace& space, 0029 const DataType& type); 0030 0031 /// 0032 /// \brief createAttribute create a new attribute on the current dataset with 0033 /// size specified by space 0034 /// \param attribute_name identifier of the attribute 0035 /// \param space Associated DataSpace 0036 /// informations 0037 /// \return Attribute Object 0038 template <typename Type> 0039 Attribute createAttribute(const std::string& attribute_name, const DataSpace& space); 0040 0041 /// 0042 /// \brief createAttribute create a new attribute on the current dataset and 0043 /// write to it, inferring the DataSpace from data. 0044 /// \param attribute_name identifier of the attribute 0045 /// \param data Associated data to write, must support DataSpace::From, see 0046 /// \ref DataSpace for more information 0047 /// \return Attribute Object 0048 /// 0049 template <typename T> 0050 Attribute createAttribute(const std::string& attribute_name, const T& data); 0051 0052 /// 0053 /// \brief deleteAttribute let you delete an attribute by its name. 0054 /// \param attribute_name identifier of the attribute 0055 void deleteAttribute(const std::string& attribute_name); 0056 0057 /// 0058 /// \brief open an existing attribute with the name attribute_name 0059 /// \param attribute_name identifier of the attribute 0060 /// \return the attribute object 0061 Attribute getAttribute(const std::string& attribute_name) const; 0062 0063 /// 0064 /// \brief return the number of attributes of the node / group 0065 /// \return number of attributes 0066 size_t getNumberAttributes() const; 0067 0068 /// 0069 /// \brief list all attribute name of the node / group 0070 /// \return number of attributes 0071 std::vector<std::string> listAttributeNames() const; 0072 0073 /// 0074 /// \brief checks an attribute exists 0075 /// \return number of attributes 0076 bool hasAttribute(const std::string& attr_name) const; 0077 0078 private: 0079 using derivate_type = Derivate; 0080 }; 0081 } // namespace HighFive
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |