Arcane
v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
StandaloneTraceMessage.h
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
/* StandaloneTraceMessage.h (C) 2000-2021 */
9
/* */
10
/* Message de trace indépendant du 'ITraceMng'. */
11
/*---------------------------------------------------------------------------*/
12
#ifndef ARCCORE_TRACE_STANDALONETRACEMESSAGE_H
13
#define ARCCORE_TRACE_STANDALONETRACEMESSAGE_H
14
/*---------------------------------------------------------------------------*/
15
/*---------------------------------------------------------------------------*/
16
17
#include "arccore/trace/TraceMessage.h"
18
19
#include <sstream>
20
21
/*---------------------------------------------------------------------------*/
22
/*---------------------------------------------------------------------------*/
23
24
namespace
Arccore
25
{
26
27
/*---------------------------------------------------------------------------*/
28
/*---------------------------------------------------------------------------*/
29
/*!
30
* \brief Gestion d'un message autonome.
31
*/
32
class
ARCCORE_TRACE_EXPORT
StandaloneTraceMessage
33
{
34
public
:
35
StandaloneTraceMessage
() =
default
;
36
StandaloneTraceMessage
(
Trace::eMessageType
,
int
level = TraceMessage::DEFAULT_LEVEL);
37
StandaloneTraceMessage
(
const
TraceMessage
& from);
38
StandaloneTraceMessage
& operator=(
const
StandaloneTraceMessage
& from);
39
40
public
:
41
std::ostream& file()
const
{
return
m_stream; }
42
Trace::eMessageType
type()
const
{
return
m_type; }
43
int
level()
const
{
return
m_level; }
44
int
color()
const
{
return
m_color; }
45
public
:
46
std::string value()
const
{
return
m_stream.str(); }
47
private
:
48
//! Flot sur lequel le message est envoyé
49
mutable
std::ostringstream m_stream;
50
//! Type de message
51
Trace::eMessageType
m_type = Trace::Normal;
52
//! Niveau du message
53
int
m_level = TraceMessage::DEFAULT_LEVEL;
54
public
:
55
//! Couleur du message.
56
mutable
int
m_color = 0;
57
};
58
59
/*---------------------------------------------------------------------------*/
60
/*---------------------------------------------------------------------------*/
61
62
inline
const
StandaloneTraceMessage
&
63
operator<<(
const
StandaloneTraceMessage
& o,
const
Trace::Color
& c)
64
{
65
o.
m_color
= c.m_color;
66
return
o;
67
}
68
69
template
<
class
T>
inline
const
StandaloneTraceMessage&
70
operator<<(
const
StandaloneTraceMessage& o,
const
T& v)
71
{
72
o.file() << v;
73
return
o;
74
}
75
76
/*---------------------------------------------------------------------------*/
77
/*---------------------------------------------------------------------------*/
78
79
}
// End namespace Arccore
80
81
/*---------------------------------------------------------------------------*/
82
/*---------------------------------------------------------------------------*/
83
84
#endif
85
Arccore::StandaloneTraceMessage
Gestion d'un message autonome.
Definition
StandaloneTraceMessage.h:33
Arccore::StandaloneTraceMessage::m_color
int m_color
Couleur du message.
Definition
StandaloneTraceMessage.h:56
Arccore::TraceMessage
Gestion d'un message.
Definition
arccore/src/trace/arccore/trace/TraceMessage.h:39
Arccore::Trace::Color
Positionne une couleur pour le message.
Definition
arccore/src/trace/arccore/trace/Trace.h:112
Arccore::Trace::eMessageType
eMessageType
Flot sur lequel on envoie les messages.
Definition
arccore/src/trace/arccore/trace/Trace.h:40
Arccore
Espace de nom de Arccore.
Definition
ArcaneTypes.h:24
arccore
trace
StandaloneTraceMessage.h
Généré le Lundi 18 Novembre 2024 02:56:58 pour Arcane par
1.9.8