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
36 std::string _traceFile;
37 std::ofstream _file;
38#if USE_THREADS
39 RTMutex *_mutex;
40#endif
41
42 RTTracer(void);
43 ~RTTracer(void);
44
45 static std::string initTraceFile(void);
46
47 static RTS_INLINE void traceMS(const RTMessage*);
48
49 void traceMessage(const RTMessage*);
50 int flush(void) override;
51
52 friend class RTActor;
53 friend class RTMessage;
54};
55
56#if RTS_INLINES
57#include <RTTracer.inl>
58#endif
59
60#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.