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 void log( long double );
78#endif
79 void log( int );
80 void log( long );
81 void log( long long );
82 void log( short );
83 void log( const RTDataObject & );
84
89 void log( const void * data, const RTObject_class * type);
90
95 RTS_INLINE void log( const RTTypedValue & );
96
97 void log( unsigned int );
98 void log( unsigned long );
99 void log( unsigned long long );
100 void log( unsigned short );
101 void log( unsigned char );
102
103 void show( char );
104#if RTUseFloatingPoint
105 void show( double );
106 void show( float );
107 void show( long double );
108#endif
109 void show( int );
110 void show( long );
111 void show( long long );
112 void show( short );
113 void show( const RTDataObject & );
114
119 void show( const void * data, const RTObject_class * type);
120
125 RTS_INLINE void show( const RTTypedValue & );
126
127 void show( unsigned int );
128 void show( unsigned long );
129 void show( unsigned long long );
130 void show( unsigned short );
131 void show( unsigned char );
132#endif
133 void space( void );
134 void tab( void );
135 void clear( void );
136
141 void commit( void );
142
143 private:
144 // unavailable methods
145 Base( const Base & );
146 Base & operator=( const Base & );
147 };
148};
149
150#if RTS_INLINES
151#include <RTLog.inl>
152#endif
153
154#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