Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ItemInfoListView.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ItemInfoListView.cc (C) 2000-2024 */
9/* */
10/* View on a list to obtain information about entities. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/ItemInfoListView.h"
15
16#include "arcane/utils/FatalErrorException.h"
17#include "arcane/core/IItemFamily.h"
18#include "arcane/core/internal/IItemFamilyInternal.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29ItemInfoListView::
30ItemInfoListView(IItemFamily* family)
31: ItemInfoListView(family ? family->_internalApi()->commonItemSharedInfo() : ItemSharedInfo::nullInstance())
32{
33}
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
42_checkValid(eItemKind expected_kind)
43{
44 IItemFamily* family = itemFamily();
45 if (!family)
46 return;
47 eItemKind my_kind = family->itemKind();
48 if (my_kind != expected_kind)
49 ARCANE_FATAL("Bad kind family={0} kind={1} expected_kind={2}",
50 family->fullName(), my_kind, expected_kind);
51}
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
56} // End namespace Arcane
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Interface of an entity family.
Definition IItemFamily.h:83
virtual eItemKind itemKind() const =0
Entity kind.
virtual String fullName() const =0
Full family name (with the mesh's name).
IItemFamily * itemFamily() const
Associated family.
void _checkValid(eItemKind expected_kind)
Checks that the entity kind matches the expected one.
Internal shared structure of a mesh entity.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eItemKind
Mesh entity type.