28#include <arccore/base/BaseTypes.h>
29#include <arccore/base/FatalErrorException.h>
30#include <arccore/base/String.h>
32#include <arccore/collections/Array.h>
40using namespace Arccore;
91 void setField(String label,
const UniqueArray<Arccore::Integer>& indices)
94 throw Alien::FatalErrorException(
"Field already defined");
110 const UniqueArray<Arccore::Integer>&
field(String label)
const
114 throw Alien::FatalErrorException(
"Field not defined");
115 return field->second;
123 const UniqueArray<Arccore::Integer>&
field(Integer i)
const
141 std::map<String, UniqueArray<Arccore::Integer>>
m_fields;
157: m_internal(new Internal(size))
164: m_internal(new Internal(size, name))
244void Space::setField(String label,
const UniqueArray<Arccore::Integer>& indices)
261const UniqueArray<Arccore::Integer>&
270const UniqueArray<Arccore::Integer>&
288std::shared_ptr<ISpace>
291 return std::make_shared<Space>(*
this);
virtual const Arccore::String & name() const =0
Get space name.
virtual Arccore::Integer size() const =0
Get space size.
Internal structure of Space object.
String fieldLabel(Integer i) const
Get the label of the i-th field.
std::map< String, UniqueArray< Arccore::Integer > > m_fields
Mapping label to indices.
Integer nbField() const
Get the number of fields.
const UniqueArray< Arccore::Integer > & field(String label) const
Get the indices associated to a label.
Internal(Integer size)
Size constructor.
const UniqueArray< Arccore::Integer > & field(Integer i) const
Get indices associated to the i-th field \para[in] i The requested field.
const String & name() const
Get space name.
Integer m_size
The size of the space.
UniqueArray< String > m_labels
Direct acces for labels.
Integer size() const
Get space size.
void setField(String label, const UniqueArray< Arccore::Integer > &indices)
Set label on matrix entries.
String m_name
The name of the space.
Internal(Integer size, String name)
Full constructor.
Implementation of an algebraic space.
Space & operator=(const Space &src)
Equal operator.
Arccore::Integer nbField() const
Get the number of fields.
Arccore::String fieldLabel(Arccore::Integer i) const
Get the label of the i-th field.
const Arccore::String & name() const
Get space name.
Arccore::Integer size() const
Get space size.
void setField(Arccore::String label, const Arccore::UniqueArray< Arccore::Integer > &indices)
Set label on matrix entries.
std::shared_ptr< Internal > m_internal
Internal implementation of a space.
const Arccore::UniqueArray< Arccore::Integer > & field(Arccore::Integer i) const
Get indices associated to the i-th field \para[in] i The requested field.
std::shared_ptr< ISpace > clone() const
Clone this object.
bool operator!=(const ISpace &space) const
Comparison operator.
bool operator==(const ISpace &space) const
Comparison operator.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --