h5cpp  0.6
A modern C++ wrapper for the HDF5 C library
selection.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 
29 #include <h5cpp/dataspace/type.hpp>
31 #include <h5cpp/core/types.hpp>
32 #include <h5cpp/core/windows.hpp>
33 #include <memory>
34 #include <list>
35 
36 namespace hdf5 {
37 namespace dataspace {
38 
43  public:
48  using UniquePointer = std::unique_ptr<Selection>;
49  using SharedPointer = std::shared_ptr<Selection>;
50 
55  Selection() = default;
56 
62  Selection(const Selection &) = default;
63 
69  virtual ~Selection();
70 
82  virtual void apply(const Dataspace &space,
83  SelectionOperation ops) const = 0;
94  virtual Dimensions dimensions() const = 0;
95 
105  virtual size_t size() const = 0;
106 
114  virtual SelectionType type() const = 0;
115 };
116 
117 #ifdef __clang__
118 #pragma clang diagnostic push
119 #pragma clang diagnostic ignored "-Wpadded"
120 #endif
124 };
125 #ifdef __clang__
126 #pragma clang diagnostic pop
127 #endif
128 
129 using SelectionPair = std::pair<SelectionOperation, Selection::SharedPointer>;
130 using SelectionList = std::list<OperationWithSelection>;
131 
132 DLL_EXPORT Dataspace operator||(const Dataspace &space, const SelectionList &selections);
133 
134 } // namespace dataspace
135 } // namespace hdf5
dataspace base class
Definition: dataspace.hpp:41
selection base class
Definition: selection.hpp:42
virtual ~Selection()
destructor
virtual void apply(const Dataspace &space, SelectionOperation ops) const =0
apply a selection onto a dataspace
virtual Dimensions dimensions() const =0
get current dimensions
std::shared_ptr< Selection > SharedPointer
Definition: selection.hpp:49
virtual SelectionType type() const =0
get the selection type
Selection()=default
default constructor
Selection(const Selection &)=default
copy constructor
virtual size_t size() const =0
get the selection size
std::unique_ptr< Selection > UniquePointer
pointer for selection stacks
Definition: selection.hpp:48
Dataspace operator||(const Dataspace &space, const Hyperslab &selection)
std::list< OperationWithSelection > SelectionList
Definition: selection.hpp:130
SelectionOperation
selection operator
Definition: type.hpp:95
std::pair< SelectionOperation, Selection::SharedPointer > SelectionPair
Definition: selection.hpp:129
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
Definition: selection.hpp:121
Selection::SharedPointer selection
Definition: selection.hpp:123
SelectionOperation operation
Definition: selection.hpp:122
#define DLL_EXPORT
Definition: windows.hpp:29