Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
BadVariantTypeException.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* BadVariantTypeException.cc (C) 2000-2018 */
9/* */
10/* Exception levée lorsqu'un variant n'est pas du type souhaité */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14
15#include "arcane/utils/ArcanePrecomp.h"
16#include "arcane/utils/Iostream.h"
17
18#include "arcane/datatype/BadVariantTypeException.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23ARCANE_BEGIN_NAMESPACE
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32BadVariantTypeException::
33BadVariantTypeException(const String& where,VariantBase::eType wrongType)
34: Exception("BadVariantType", where)
35, m_wrong_type(wrongType)
36{
37}
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42void BadVariantTypeException::
43explain(std::ostream& m) const
44{
45 m << "Invalid type for a variant: " << VariantBase::typeName(m_wrong_type)
46 << '\n';
47}
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
52ARCANE_END_NAMESPACE
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/