Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 08:55:36

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 "H5DataSet.hpp"
0012 #include "H5DataSpace.hpp"
0013 #include "bits/H5Slice_traits.hpp"
0014 #include "bits/H5Friends.hpp"
0015 
0016 namespace HighFive {
0017 
0018 namespace detail {
0019 Selection make_selection(const DataSpace&, const DataSpace&, const DataSet&);
0020 }
0021 
0022 ///
0023 /// \brief Selection: represent a view on a slice/part of a dataset
0024 ///
0025 /// A Selection is valid only if its parent dataset is valid
0026 ///
0027 class Selection: public SliceTraits<Selection> {
0028   public:
0029     ///
0030     /// \brief getSpace
0031     /// \return Dataspace associated with this selection
0032     ///
0033     DataSpace getSpace() const noexcept;
0034 
0035     ///
0036     /// \brief getMemSpace
0037     /// \return Dataspace associated with the memory representation of this
0038     /// selection
0039     ///
0040     DataSpace getMemSpace() const noexcept;
0041 
0042     ///
0043     /// \brief getDataSet
0044     /// \return parent dataset of this selection
0045     ///
0046     DataSet& getDataset() noexcept;
0047     const DataSet& getDataset() const noexcept;
0048 
0049     ///
0050     /// \brief return the datatype of the selection
0051     /// \return return the datatype of the selection
0052     const DataType getDataType() const;
0053 
0054   protected:
0055     Selection(const DataSpace& memspace, const DataSpace& file_space, const DataSet& set);
0056 
0057   private:
0058     DataSpace _mem_space, _file_space;
0059     DataSet _set;
0060 
0061 #if HIGHFIVE_HAS_FRIEND_DECLARATIONS
0062     template <typename Derivate>
0063     friend class ::HighFive::SliceTraits;
0064 #endif
0065     friend Selection detail::make_selection(const DataSpace&, const DataSpace&, const DataSet&);
0066 };
0067 
0068 }  // namespace HighFive