h5cpp  0.5.2
A modern C++ wrapper for the HDF5 C library
points.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2017 DESY,ESS
3 //
4 // This file is part of h5cpp.
5 //
6 // This library is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU Lesser General Public License as published
8 // by the Free Software Foundation; either version 2.1 of the License, or
9 // (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the
18 // Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
19 // Boston, MA 02110-1301 USA
20 // ===========================================================================
21 //
22 // Authors:
23 // Eugen Wintersberger <eugen.wintersberger@desy.de>
24 // Martin Shetty <martin.shetty@esss.se>
25 // Created on: Aug 25, 2017
26 //
27 #pragma once
28 
30 #include <h5cpp/core/windows.hpp>
31 
32 namespace hdf5
33 {
34 namespace dataspace
35 {
36 
41 class DLL_EXPORT Points : public Selection
42 {
43  public:
48  Points () = default;
49 
54  ~Points () override = default;
55 
63  explicit Points (size_t rank);
64 
74  explicit Points (const std::vector<std::vector<hsize_t>>& coord_set);
75 
81  size_t rank () const;
82 
88  size_t points () const;
89 
96  void add (const std::vector<hsize_t>& coords);
97 
104  void add_set (const std::vector<std::vector<hsize_t>>& coord_set);
105 
113  void apply (const Dataspace &space, SelectionOperation ops) const override;
114 
124  virtual size_t size() const override;
125 
133  virtual SelectionType type() const override;
134 
145  virtual Dimensions dimensions() const override;
146 
147  private:
148  size_t rank_{ 0 };
149 #ifdef _MSC_VER
150 #pragma warning(push)
151 #pragma warning(disable: 4251)
152 #endif
153  std::vector<hsize_t> coordinates_;
154 #ifdef _MSC_VER
155 #pragma warning(pop)
156 #endif
157 };
158 
159 } // namespace dataspace
160 } // namespace hdf5
dataspace base class
Definition: dataspace.hpp:41
point selection implementation
Definition: points.hpp:42
~Points() override=default
destructor
size_t points() const
get the number of points in the selection
virtual size_t size() const override
get the selection size
virtual Dimensions dimensions() const override
get current dimensions
Points(const std::vector< std::vector< hsize_t >> &coord_set)
constructor
void add_set(const std::vector< std::vector< hsize_t >> &coord_set)
add point set to the selection
size_t rank() const
get the number of dimensions
void add(const std::vector< hsize_t > &coords)
add a new point to the selection
Points()=default
default constructor
virtual SelectionType type() const override
get the selection type
Points(size_t rank)
constructor
void apply(const Dataspace &space, SelectionOperation ops) const override
apply the selection to a dataspace
selection base class
Definition: selection.hpp:42
SelectionOperation
selection operator
Definition: type.hpp:95
SelectionType
selection type
Definition: type.hpp:71
top-level namespace of the entire library
Definition: attribute.hpp:45
std::vector< hsize_t > Dimensions
Definition: types.hpp:32
#define DLL_EXPORT
Definition: windows.hpp:29