C++ TargetRTS
Loading...
Searching...
No Matches
RTLog.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTLog_h__
11#define __RTLog_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTProtocol_h__
18#include <RTProtocol.h>
19#endif
20
21class RTDataObject;
22struct RTObject_class;
23class RTString;
24struct RTTypedValue;
25
27struct Log
28{
30 class Base : public RTProtocol
31 {
32 private:
33 // this will eventually be a file descriptor.
34 int file;
35
36 public:
37 RTS_INLINE Base( void );
38 RTS_INLINE ~Base( void );
39
40 static const RTProtocolDescriptor rt_class;
41
43 RTS_INLINE void cr( void );
44
45 void crtab( int = 1 );
46
47 // The below functions need not be called
48 void open( const char * );
49 void open( void );
50 void close( void );
51
55 void log( const char * str);
56
60 void log( const RTString & str);
61
65 void show( const char * str);
66
70 void show( const RTString & str);
71
72#if OBJECT_ENCODE
73 void log( char );
74#if RTUseFloatingPoint
75 void log( double );
76 void log( float );
77#endif
78 void log( int );
79 void log( long );
80 void log( long long );
81 void log( short );
82 void log( const RTDataObject & );
83
88 void log( const void * data, const RTObject_class * type);
89
94 RTS_INLINE void log( const RTTypedValue & );
95
96 void log( unsigned int );
97 void log( unsigned long );
98 void log( unsigned long long );
99 void log( unsigned short );
100 void log( unsigned char );
101
102 void show( char );
103#if RTUseFloatingPoint
104 void show( double );
105 void show( float );
106#endif
107 void show( int );
108 void show( long );
109 void show( long long );
110 void show( short );
111 void show( const RTDataObject & );
112
117 void show( const void * data, const RTObject_class * type);
118
123 RTS_INLINE void show( const RTTypedValue & );
124
125 void show( unsigned int );
126 void show( unsigned long );
127 void show( unsigned long long );
128 void show( unsigned short );
129 void show( unsigned char );
130#endif
131 void space( void );
132 void tab( void );
133 void clear( void );
134
139 void commit( void );
140
141 private:
142 // unavailable methods
143 Base( const Base & );
144 Base & operator=( const Base & );
145 };
146};
147
148#if RTS_INLINES
149#include <RTLog.inl>
150#endif
151
152#endif // __RTLog_h__
Represents a log port.
Definition: RTLog.h:31
void log(const void *data, const RTObject_class *type)
Print the default ASCII encoding of an object to the log, followed by a carriage return.
void log(const char *str)
Print a string to the log, followed by a carriage return.
void commit(void)
Flush all buffered characters to the log.
void cr(void)
Print a carriage return to the log.
Definition: RTLog.inl:35
void show(const RTString &str)
Print a string to the log.
void log(const RTString &str)
Print a string to the log, followed by a carriage return.
void show(const void *data, const RTObject_class *type)
Print the default ASCII encoding of an object to the log.
void show(const char *str)
Print a string to the log.
Provides a common interface to certain data type implementations (e.g.
Definition: RTDataObject.h:33
Represents a general capsule port typed by a protocol which determines the set of events that can be ...
Definition: RTProtocol.h:50
A C-style string wrapped in a data object.
Definition: RTString.h:24
Represents the predefined "Log" protocol.
Definition: RTLog.h:28
A type descriptor providing information about a type.
Definition: RTObject_class.h:64
Definition: RTProtocolDescriptor.h:40
Encapsulates a data object and its type descriptor.
Definition: RTTypedValue.h:29