Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
CompositeSpace.h
1/*
2 * Copyright 2020 IFPEN-CEA
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * SPDX-License-Identifier: Apache-2.0
17 */
18
19#pragma once
20
21#include <memory>
22
23#include <alien/data/ISpace.h>
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Alien
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34namespace CompositeKernel
35{
36
37 /*---------------------------------------------------------------------------*/
38 /*---------------------------------------------------------------------------*/
39
40 class ALIEN_EXPORT Space : public ISpace
41 {
42 public:
43 Space();
44
45 Space(const Space&);
46 Space(Space&&);
47
48 Space& operator=(const Space& src);
49 Space& operator=(Space&&);
50
51 public:
52 bool operator==(const ISpace& space) const;
53 bool operator!=(const ISpace& space) const;
54
55 Integer size() const;
56
57 const String& name() const;
58
59 void setField(String label, const UniqueArray<Integer>& indices);
60
61 Integer nbField() const;
62
63 String fieldLabel(Integer i) const;
64
65 const UniqueArray<Integer>& field(Integer i) const;
66 const UniqueArray<Integer>& field(String label) const;
67
68 std::shared_ptr<ISpace> clone() const;
69
70 public:
71 void resizeSubSpace(Integer size);
72
73 std::shared_ptr<ISpace>& operator[](Integer i);
74
75 const std::shared_ptr<ISpace>& operator[](Integer i) const;
76
77 Integer subSpaceSize() const;
78
79 private:
80 struct Internal;
81
82 std::shared_ptr<Internal> m_internal;
83 };
84
85 /*---------------------------------------------------------------------------*/
86 /*---------------------------------------------------------------------------*/
87
88} // namespace CompositeKernel
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
92
93} // namespace Alien
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
ISpace.h.
bool operator==(const ISpace &space) const
Comparison operator.
const String & name() const
Get space name.
bool operator!=(const ISpace &space) const
Comparison operator.
Integer size() const
Get space size.
std::shared_ptr< ISpace > clone() const
Clone this object.
Integer nbField() const
Get the number of fields.
ISpace()
Constructor.
Definition ISpace.h:47
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17