Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
ISpace.h
Go to the documentation of this file.
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
23
24#pragma once
25
26#include <alien/utils/Precomp.h>
27
28#include <arccore/collections/Array.h>
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33namespace Alien
34{
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
43class ALIEN_EXPORT ISpace
44{
45 protected:
47 ISpace() {}
48
49 private:
50 /* Forbid use of copy and move constructors for implementations. */
51 ISpace(const ISpace&) = delete;
52
53 ISpace(ISpace&&) = delete;
54
55 void operator=(const ISpace&) = delete;
56
57 void operator=(ISpace&&) = delete;
58
59 public:
61 virtual ~ISpace() {}
62
68 virtual bool operator==(const ISpace& space) const = 0;
69
75 virtual bool operator!=(const ISpace& space) const = 0;
76
81 virtual Arccore::Integer size() const = 0;
82
87 virtual const Arccore::String& name() const = 0;
88
94 virtual void setField(
95 Arccore::String label, const Arccore::UniqueArray<Arccore::Integer>& indices) = 0;
96
101 virtual Arccore::Integer nbField() const = 0;
102
108 virtual Arccore::String fieldLabel(Arccore::Integer i) const = 0;
109
115 virtual const Arccore::UniqueArray<Arccore::Integer>& field(
116 Arccore::Integer i) const = 0;
117
123 virtual const Arccore::UniqueArray<Arccore::Integer>& field(
124 Arccore::String label) const = 0;
125
130 virtual std::shared_ptr<ISpace> clone() const = 0;
131};
132
133/*---------------------------------------------------------------------------*/
134/*---------------------------------------------------------------------------*/
135
136} // namespace Alien
137
138/*---------------------------------------------------------------------------*/
139/*---------------------------------------------------------------------------*/
Interface for algebraic space objects.
Definition ISpace.h:44
virtual std::shared_ptr< ISpace > clone() const =0
Clone this object.
virtual Arccore::Integer nbField() const =0
Get the number of fields.
virtual const Arccore::UniqueArray< Arccore::Integer > & field(Arccore::String label) const =0
Get the indices associated to a label.
virtual bool operator==(const ISpace &space) const =0
Comparison operator.
virtual ~ISpace()
Free resources.
Definition ISpace.h:61
virtual const Arccore::String & name() const =0
Get space name.
virtual Arccore::String fieldLabel(Arccore::Integer i) const =0
Get the label of the i-th field.
virtual bool operator!=(const ISpace &space) const =0
Comparison operator.
virtual Arccore::Integer size() const =0
Get space size.
virtual void setField(Arccore::String label, const Arccore::UniqueArray< Arccore::Integer > &indices)=0
Set label on matrix entries.
virtual const Arccore::UniqueArray< Arccore::Integer > & field(Arccore::Integer i) const =0
Get indices associated to the i-th field \para[in] i The requested field.
ISpace()
Constructor.
Definition ISpace.h:47
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17