0023072: Eliminate compiler warnings (level 3) on Windows / MSVC++
[occt.git] / src / Message / Message_Messenger.cdl
1 -- Created on: 2007-06-28
2 -- Created by: OCC Team
3 -- Copyright (c) 2007-2012 OPEN CASCADE SAS
4 --
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
9 --
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 --
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
19
20
21 class Messenger from Message inherits TShared from MMgt
22
23     ---Purpose: Messenger is API class providing general-purpose interface for 
24     --          libraries that may issue text messages without knowledge
25     --          of how these messages will be further processed.
26     --          
27     --          The messenger contains a sequence of "printers" which can be 
28     --          customized by the application, and dispatches every received 
29     --          message to all the printers.
30     --  
31     --          For convenience, a number of operators << are defined with left
32     --          argument being Handle(Message_Messenger); thus it can be used
33     --          with syntax similar to C++ streams.
34     --          Note that all these operators use trace level Warning.
35
36 uses
37
38     Printer            from Message,
39     PrinterOStream     from Message,
40     SequenceOfPrinters from Message,
41     Gravity            from Message,
42     AsciiString        from TCollection,
43     ExtendedString     from TCollection    
44
45 is
46
47     Create returns Messenger from Message;
48         ---Purpose: Empty constructor; initializes by single printer directed to cout.
49         --          Note: the default messenger is not empty but directed to cout
50         --          in order to protect against possibility to forget defining printers.
51         --          If printing to cout is not needed, clear messenger by GetPrinters().Clear()
52
53     Create (thePrinter: Printer from Message)
54     returns Messenger from Message;
55         ---Purpose: Create messenger with single printer
56
57     AddPrinter (me: mutable; thePrinter: Printer from Message)
58     returns Boolean from Standard;
59         ---Purpose: Add a printer to the messenger.
60         --          The printer will be added only if it is not yet in the list.
61         --          Returns True if printer has been added.
62
63     RemovePrinter (me: mutable; thePrinter: Printer from Message)
64     returns Boolean from Standard;
65         ---Purpose: Removes specified printer from the messenger.
66         --          Returns True if this printer has been found in the list 
67         --          and removed.
68
69     RemovePrinters (me: mutable; theType: Type from Standard)
70     returns Integer from Standard;
71         ---Purpose: Removes printers of specified type (including derived classes)
72         --          from the messenger.
73         --          Returns number of removed printers.
74
75     Printers(me)
76     returns SequenceOfPrinters from Message;
77         ---C++: inline
78         ---C++: return const &
79         ---Purpose: Returns current sequence of printers
80         
81     ChangePrinters(me: mutable)
82     returns SequenceOfPrinters from Message;
83         ---C++: inline
84         ---C++: return &
85         ---Purpose: Returns sequence of printers
86         --          The sequence can be modified.
87         
88     Send (me; theString : CString from Standard;
89               theGravity: Gravity from Message = Message_Warning;
90               putEndl: Boolean from Standard = Standard_True);
91         ---Purpose: Dispatch a message to all the printers in the list.
92         --          Three versions of string representations are accepted for 
93         --          convenience, by default all are converted to ExtendedString.
94         --          The parameter putEndl specifies whether the new line should 
95         --          be started after this message (default) or not (may have 
96         --          sense in some conditions).
97
98     Send (me; theString : AsciiString from TCollection;
99               theGravity: Gravity from Message =  Message_Warning;
100               putEndl: Boolean from Standard = Standard_True);
101         ---Purpose: See above
102
103     Send (me; theString : ExtendedString from TCollection;
104               theGravity: Gravity from Message = Message_Warning;
105               putEndl: Boolean from Standard = Standard_True);
106         ---Purpose: See above
107
108 fields
109
110     myPrinters: SequenceOfPrinters from Message;
111
112 end Messenger;