C++ TargetRTS
Loading...
Searching...
No Matches
RTDiagStream.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 __RTDiagStream_h__
11#define __RTDiagStream_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTConfig_h__
18#include <RTConfig.h>
19#endif
20
21#if RTUseCPP11
22#include <cstdint>
23#include <type_traits>
24#endif
25
26class RTDataObject;
27class RTMutex;
28struct RTObject_class;
29struct RTTimespec;
30
31// It is safe to ignore the return value of these functions.
32//lint -esym(534,RTDiagStream::lock)
33//lint -esym(534,operator<<)
34//lint -esym(534,RTDiagStream::unlock)
35//lint -esym(534,RTDiagStream::write)
36
38{
39public:
40 RTDiagStream( void );
41 ~RTDiagStream( void );
42
43 RTS_INLINE RTDiagStream & lock( void );
44 RTDiagStream & write( const char * );
45#if OBJECT_ENCODE
46 RTDiagStream & write( const void *, const RTObject_class * );
47#endif
48 void flush( void );
49 RTS_INLINE RTDiagStream & unlock( void );
50
51private:
52#if USE_THREADS
53 RTMutex * _mutex;
54#endif
55
56 // unavailable methods
57 RTDiagStream( const RTDiagStream & );
58 RTDiagStream & operator=( const RTDiagStream & );
59};
60
61RTS_INLINE RTDiagStream & operator<<( RTDiagStream &, const char * );
62 RTDiagStream & operator<<( RTDiagStream &, const char * const * );
63 RTDiagStream & operator<<( RTDiagStream &, const void * );
64 RTDiagStream & operator<<( RTDiagStream &, long );
65 RTDiagStream & operator<<( RTDiagStream &, unsigned long );
66
67#if RTUseCPP11
68 template<typename T>
69 typename std::enable_if<std::is_same<T, int64_t>::value, RTDiagStream&>::type
70 operator<<( RTDiagStream& ds, T value );
71
72 template<typename T>
73 typename std::enable_if<std::is_same<T, uint64_t>::value, RTDiagStream&>::type
74 operator<<( RTDiagStream& ds, T value );
75#endif
76
77RTS_INLINE RTDiagStream & operator<<( RTDiagStream &, char );
78RTS_INLINE RTDiagStream & operator<<( RTDiagStream &, unsigned char );
79RTS_INLINE RTDiagStream & operator<<( RTDiagStream &, short );
80RTS_INLINE RTDiagStream & operator<<( RTDiagStream &, unsigned short );
81RTS_INLINE RTDiagStream & operator<<( RTDiagStream &, int );
82RTS_INLINE RTDiagStream & operator<<( RTDiagStream &, unsigned );
83
84#if RTS_INLINES
85#include <RTDiagStream.inl>
86#endif
87
88#endif // __RTDiagStream_h__
Provides a common interface to certain data type implementations (e.g.
Definition: RTDataObject.h:33
Definition: RTDiagStream.h:38
A type descriptor providing information about a type.
Definition: RTObject_class.h:64
A time value which can represent either an absolute or relative time.
Definition: RTTimespec.h:29