PdCom  5.3
Process data communication client
Selector.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vim:tw=78
3  *
4  * Copyright (C) 2021 Richard Hacker (lerichi at gmx dot net),
5  * Florian Pose (fp at igh dot de),
6  * Bjarne von Horn (vh at igh dot de).
7  *
8  * This file is part of the PdCom library.
9  *
10  * The PdCom library is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or (at your
13  * option) any later version.
14  *
15  * The PdCom library is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with the PdCom library. If not, see <http://www.gnu.org/licenses/>.
22  *
23  *****************************************************************************/
24 
27 #ifndef PDCOM5_SELECTOR_H
28 #define PDCOM5_SELECTOR_H
29 
30 #include "SizeTypeInfo.h"
31 
32 #include <memory>
33 #include <pdcom5_export.h>
34 #include <vector>
35 
36 namespace PdCom {
37 namespace impl {
38 struct Selector;
39 } // namespace impl
40 class Variable;
41 
42 
47 struct PDCOM5_PUBLIC Selector
48 {
49  std::shared_ptr<const impl::Selector> impl_;
50 
51  Selector();
52  Selector(std::shared_ptr<const impl::Selector> impl) :
53  impl_(std::move(impl))
54  {}
55 
56  SizeInfo getViewSizeInfo(const Variable &variable) const;
57 };
58 
63 struct PDCOM5_PUBLIC ScalarSelector : Selector
64 {
65  ScalarSelector(std::vector<int> indices);
66 };
67 
68 
69 } // namespace PdCom
70 
71 #endif // PDCOM5_SELECTOR_H
Size of a Variable.
Definition: SizeTypeInfo.h:66
Selector base class for creating views on multidimensional data.
Definition: Selector.h:47
PdCom Variable interface.
Definition: Variable.h:67
Definition: ClientStatistics.h:31
Selects one scalar out of a vector or matrix.
Definition: Selector.h:63