Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
DefaultAbstractFamily.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 <alien/index_manager/IAbstractFamily.h>
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Alien
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
34class ALIEN_EXPORT DefaultAbstractFamily : public IAbstractFamily
35{
36 public:
37 DefaultAbstractFamily(const DefaultAbstractFamily& family);
38
45 DefaultAbstractFamily(ConstArrayView<Int64> uniqueIds,
46 ConstArrayView<Integer> owners,
47 IMessagePassingMng* parallel_mng);
48
54 DefaultAbstractFamily(ConstArrayView<Int64> uniqueIds,
55 IMessagePassingMng* parallel_mng);
56
57 ~DefaultAbstractFamily() override = default;
58
59 public:
60 IAbstractFamily* clone() const override { return new DefaultAbstractFamily(*this); }
61
62 public:
63 Int32 maxLocalId() const override { return m_unique_ids.size(); }
64
65 void uniqueIdToLocalId(
66 ArrayView<Int32> localIds, ConstArrayView<Int64> uniqueIds) const override;
67
68 IAbstractFamily::Item item(Int32 localId) const override;
69
70 SafeConstArrayView<Integer> owners(ConstArrayView<Int32> localIds) const override;
71
72 SafeConstArrayView<Int64> uids(ConstArrayView<Int32> localIds) const override;
73
74 SafeConstArrayView<Int32> allLocalIds() const override;
75
76 private:
77 IMessagePassingMng* m_parallel_mng;
78 UniqueArray<Int64> m_unique_ids;
79 UniqueArray<Integer> m_owners;
80};
81
82/*---------------------------------------------------------------------------*/
83/*---------------------------------------------------------------------------*/
84
85} // namespace Alien
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
Int32 maxLocalId() const override
Max local Id for this family.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17