0027104: DownCast() cannot return null for mismatched handle
[occt.git] / src / Message / Message_Printer.hxx
CommitLineData
42cf5bc1 1// Created on: 2001-01-06
2// Created by: OCC Team
3// Copyright (c) 2001-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _Message_Printer_HeaderFile
17#define _Message_Printer_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_Type.hxx>
21
22#include <Message_Gravity.hxx>
23#include <MMgt_TShared.hxx>
24#include <Standard_Boolean.hxx>
25#include <Standard_CString.hxx>
26class TCollection_ExtendedString;
27class TCollection_AsciiString;
28
29
30class Message_Printer;
31DEFINE_STANDARD_HANDLE(Message_Printer, MMgt_TShared)
32
33//! Abstract interface class defining printer as output context for text messages
34//!
35//! The message, besides being text string, has associated gravity
36//! level, which can be used by printer to decide either to process a message or ignore it.
37class Message_Printer : public MMgt_TShared
38{
39
40public:
41
42
43 //! Return trace level used for filtering messages;
44 //! messages with lover gravity will be ignored.
45 Message_Gravity GetTraceLevel() const;
46
47 //! Set trace level used for filtering messages.
48 //! By default, trace level is Message_Info, so that all messages are output
49 void SetTraceLevel (const Message_Gravity theTraceLevel);
50
51 //! Send a string message with specified trace level.
52 //! The parameter theToPutEol specified whether end-of-line should be added to the end of the message.
53 //! This method must be redefined in descentant.
54 Standard_EXPORT virtual void Send (const TCollection_ExtendedString& theString, const Message_Gravity theGravity, const Standard_Boolean theToPutEol) const = 0;
55
56 //! Send a string message with specified trace level.
57 //! The parameter theToPutEol specified whether end-of-line should be added to the end of the message.
58 //! Default implementation calls first method Send().
59 Standard_EXPORT virtual void Send (const Standard_CString theString, const Message_Gravity theGravity, const Standard_Boolean theToPutEol) const;
60
61 //! Send a string message with specified trace level.
62 //! The parameter theToPutEol specified whether end-of-line should be added to the end of the message.
63 //! Default implementation calls first method Send().
64 Standard_EXPORT virtual void Send (const TCollection_AsciiString& theString, const Message_Gravity theGravity, const Standard_Boolean theToPutEol) const;
65
66
67
68
92efcf78 69 DEFINE_STANDARD_RTTIEXT(Message_Printer,MMgt_TShared)
42cf5bc1 70
71protected:
72
73
74 //! Empty constructor with Message_Info trace level
75 Standard_EXPORT Message_Printer();
76
77 Message_Gravity myTraceLevel;
78
79
80private:
81
82
83
84
85};
86
87
88#include <Message_Printer.lxx>
89
90
91
92
93
94#endif // _Message_Printer_HeaderFile