Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
InvalidArgumentException.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/* InvalidArgumentException.h (C) 2000-2016 */
9/* */
10/* Exception when an argument is invalid. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_INVALIDARGUMENTEXCEPTION_H
13#define ARCANE_UTILS_INVALIDARGUMENTEXCEPTION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Exception.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
31class ARCANE_UTILS_EXPORT InvalidArgumentException
32: public Exception
33{
34 public:
35
36 InvalidArgumentException(const TraceInfo& where, const String& arg_name, int arg);
37 InvalidArgumentException(const TraceInfo& where, const String& arg_name, double arg);
38 InvalidArgumentException(const TraceInfo& where, const String& arg_name, const String& arg);
39 InvalidArgumentException(const TraceInfo& where, const String& arg_name, const void* arg);
40
41 InvalidArgumentException(const TraceInfo& where, const String& arg_name, const String& message, int arg);
42 InvalidArgumentException(const TraceInfo& where, const String& arg_name, const String& message, double arg);
43 InvalidArgumentException(const TraceInfo& where, const String& arg_name, const String& message, const String& arg);
44 InvalidArgumentException(const TraceInfo& where, const String& arg_name, const String& message, const void* arg);
45
46 InvalidArgumentException(const InvalidArgumentException& ex);
47
48 ~InvalidArgumentException() ARCANE_NOEXCEPT {}
49
50 public:
51
52 virtual void explain(std::ostream& m) const;
53
54 private:
55
56 String m_arg_name;
57 String m_arg_value;
58 String m_message;
59
60 template <typename U>
61 void _init(const U& arg_value);
62};
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
67} // namespace Arcane
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72#endif
const String & where() const
Location of the exception.
const String & message() const
Exception message.
Exception(const String &name, const String &where)
virtual void explain(std::ostream &m) const
Explains the cause of the exception in the stream o.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --