Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ExpressionResult.h
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/* ExpressionResult.h (C) 2000-2005 */
9/* */
10/* Contains the result of an expression evaluation. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_EXPR_EXPRESSIONRESULT_H
13#define ARCANE_CORE_EXPR_EXPRESSIONRESULT_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19//%% ARCANE_EXPR_SUPPRESS_BEGIN
20#include "arcane/core/IVariable.h"
21//%% ARCANE_EXPR_SUPPRESS_END
22
23#include "arcane/core/datatype/ArrayVariant.h"
24
25#include "arcane/utils/Array.h"
26#include "arcane/utils/Iostream.h"
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Arcane
32{
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
40class ARCANE_EXPR_EXPORT ExpressionResult
41{
42 public:
43//%% ARCANE_EXPR_SUPPRESS_BEGIN
44 ExpressionResult(IVariable* v);
45//%% ARCANE_EXPR_SUPPRESS_END
46 ExpressionResult(ArrayVariant* data);
47 ExpressionResult(IntegerConstArrayView indices);
48 ~ExpressionResult();
49
50 public:
51 void allocate(VariantBase::eType type);
52
53 public:
54 ArrayVariant* data() const { return m_data; }
55 IntegerConstArrayView indices () const { return m_indices; }
56 Integer size() const { return m_indices.size(); }
57
58 public:
59 friend std::ostream& operator<<(std::ostream& s, const ExpressionResult& x);
60
61 private:
62//%% ARCANE_EXPR_SUPPRESS_BEGIN
63 void _init(IVariable* v);
64//%% ARCANE_EXPR_SUPPRESS_END
65
66 private:
67 ArrayVariant* m_data;
68 IntegerConstArrayView m_indices;
70};
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75}
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
80#endif
Arcane configuration file.
Polymorphic base type for arrays (dimension 1).
UniqueArray< Integer > m_own_indices
Array of indices allocated by this instance.
Interface of a variable.
Definition IVariable.h:40
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Integer > IntegerConstArrayView
C equivalent of a 1D array of integers.
Definition UtilsTypes.h:486