C++ TargetRTS
Loading...
Searching...
No Matches
RTTracer.h
1/*******************************************************************************
2 * Licensed Materials - Property of HCL
3 * (c) Copyright HCL Technologies Ltd. 2025. All Rights Reserved.
4 *******************************************************************************/
5#ifndef __RTTracer_h__
6#define __RTTracer_h__ included
7
8#include <fstream>
9#include <RTStreamBuffer.h>
10#include <string>
11
12class RTMessage;
13class RTMutex;
14
15class RTTracer: public RTStreamBuffer {
16public:
20 static RTS_INLINE void flushTrace(void);
21
25 static RTS_INLINE bool isEnabled(void);
26
31 static void setEnabled(bool);
32
33protected:
34 static bool _enabled;
35 static unsigned int _format;
36
37 std::string _traceFile;
38 std::ofstream _file;
39#if USE_THREADS
40 RTMutex *_mutex;
41#endif
42
43 RTTracer(void);
44 ~RTTracer(void);
45
46 static std::string initTraceFile(void);
47
48 static RTS_INLINE void traceMS(const RTMessage*);
49
50 void traceMessage(const RTMessage*);
51 int flush(void) override;
52
53 friend class RTActor;
54 friend class RTMessage;
55};
56
57#if RTS_INLINES
58#include <RTTracer.inl>
59#endif
60
61#endif
An instance of this class represents a capsule instance.
Definition: RTActor.h:44
Represents a message used for communication between capsule instances.
Definition: RTMessage.h:33
Definition: RTStreamBuffer.h:22
Definition: RTTracer.h:15
static void flushTrace(void)
Flush buffered trace messages to file.
Definition: RTTracer.inl:12
static bool isEnabled(void)
Check if tracing is enabled.
Definition: RTTracer.inl:16
static void setEnabled(bool)
Enable or disable tracing to file.
int flush(void) override
Flushes the data written to the buffer.