Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
ScalarIndexSet.cc
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#include "ScalarIndexSet.h"
20
21#include <list>
22
23#include <alien/index_manager/IndexManager.h>
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Alien
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
35{
36 const String m_name;
37 const Integer m_kind;
38 const Integer m_uid;
39 const IndexManager* m_manager;
40};
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
44
45ScalarIndexSet::ScalarIndexSet() = default;
46
47/*---------------------------------------------------------------------------*/
48
49ScalarIndexSet::ScalarIndexSet(const ScalarIndexSet& en) = default;
50
51/*---------------------------------------------------------------------------*/
52
53ScalarIndexSet::ScalarIndexSet(ScalarIndexSet&& en) noexcept
54: m_internal(std::move(en.m_internal))
55{}
56
57/*---------------------------------------------------------------------------*/
58
59ScalarIndexSet::ScalarIndexSet(
60const String& name, const Integer uid, const IndexManager* manager, Integer kind)
61: m_internal(new Internal{ name, kind, uid, manager })
62{}
63
64/*---------------------------------------------------------------------------*/
65
66ScalarIndexSet& ScalarIndexSet::operator=(const ScalarIndexSet& en) = default;
67
68/*---------------------------------------------------------------------------*/
69
70//! Opérateur de copie
71ScalarIndexSet&
72ScalarIndexSet::operator=(ScalarIndexSet&& en) noexcept
73{
74 m_internal = std::move(en.m_internal);
75 return *this;
76}
77
78/*---------------------------------------------------------------------------*/
79
80//! Opérateur de comparaison
81bool ScalarIndexSet::operator==(const ScalarIndexSet& en) const
82{
83 return m_internal == en.m_internal;
84}
85
86/*---------------------------------------------------------------------------*/
87
88ConstArrayView<Integer>
90{
91 return manager()->getOwnIndexes(*this);
92}
93
94/*---------------------------------------------------------------------------*/
95
96ConstArrayView<Integer>
98{
99 return manager()->getAllIndexes(*this);
100}
101
102/*---------------------------------------------------------------------------*/
103
104ConstArrayView<Integer>
105ScalarIndexSet::getOwnLocalIds() const
106{
107 return manager()->getOwnLocalIds(*this);
108}
109
110/*---------------------------------------------------------------------------*/
111
112ConstArrayView<Integer>
113ScalarIndexSet::getAllLocalIds() const
114{
115 return manager()->getAllLocalIds(*this);
116}
117
118/*---------------------------------------------------------------------------*/
119
120String
121ScalarIndexSet::getName() const
122{
123 return m_internal->m_name;
124}
125
126/*---------------------------------------------------------------------------*/
127
128Integer
130{
131 return m_internal->m_kind;
132}
133
134/*---------------------------------------------------------------------------*/
135
136const IAbstractFamily&
137ScalarIndexSet::getFamily() const
138{
139 return manager()->getFamily(*this); //*m_internal->m_family;
140}
141
142/*---------------------------------------------------------------------------*/
143
144const IndexManager*
146{
147 return m_internal->m_manager;
148}
149
150/*---------------------------------------------------------------------------*/
151
152Integer
154{
155 return m_internal->m_uid;
156}
157
158/*---------------------------------------------------------------------------*/
159/*---------------------------------------------------------------------------*/
160
161} // namespace Alien
162
163/*---------------------------------------------------------------------------*/
164/*---------------------------------------------------------------------------*/
Interface for abstract families of items.
bool operator==(const ScalarIndexSet &en) const
Opérateur de comparaison.
ConstArrayView< Integer > getOwnIndexes() const
Indices of owned, for this entry.
Integer getUid() const
Creation label.
const IndexManager * manager() const
Associated index manager.
Integer getKind() const
Item where the entry is defined.
ConstArrayView< Integer > getAllIndexes() const
Indices of owned then ghosts, for this entry.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17