CTR Pia  4.11.3
Game Communication Engine
common_Trace.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: common_Trace.h
4 
5  Copyright Nintendo. All rights reserved.
6 
7  These coded instructions, statements, and computer programs contain
8  proprietary information of Nintendo of America Inc. and/or Nintendo
9  Company Ltd., and are protected by Federal copyright law. They may
10  not be disclosed to third parties or copied or duplicated in any form,
11  in whole or in part, without the prior written consent of Nintendo.
12  *---------------------------------------------------------------------------*/
13 
14 
15 #pragma once
16 
17 #include <pia/common/common_StringStream.h>
18 #include <pia/common/common_EmptyStream.h>
19 #include <pia/common/common_Time.h>
20 
21 
22 namespace nn
23 {
24 namespace pia
25 {
26 namespace common
27 {
28 
29 #if NN_PIA_ENABLE_TRACE
30 /*!
31 @cond PRIVATE
32 @brief Outputs trace information.
33 */
34 #define PIA_TRACE(FLAG, ...) \
35  \
36 { \
37  nn::pia::common::Trace* pNnPiaCommonTrace = nn::pia::common::Trace::GetInstance(); \
38  if (pNnPiaCommonTrace) \
39  { \
40  if (pNnPiaCommonTrace->IsFlagSet(FLAG)) \
41  { \
42  pNnPiaCommonTrace->WriteCaption(); \
43  pNnPiaCommonTrace->Write(__VA_ARGS__); \
44  pNnPiaCommonTrace->Write("\n"); \
45  } \
46  } \
47  \
48 }
49 //! @endcond
50 
51 /*!
52 @cond PRIVATE
53 @brief Converts a <tt>bool</tt> value to a string.
54 */
55 #define PIA_BOOL_TO_TEXT(VALUE) ((VALUE) ? "true" : "false")
56 //! @endcond
57 
58 
59 /*!
60 @cond PRIVATE
61 @brief Takes stream-format arguments and outputs them to trace.
62 */
63 #define PIA_TRACE_STREAM(FLAG, ARGS) \
64  \
65 { \
66  nn::pia::common::Trace* pNnPiaCommonTrace = nn::pia::common::Trace::GetInstance(); \
67  if (pNnPiaCommonTrace) \
68  { \
69  if (pNnPiaCommonTrace->IsFlagSet(FLAG)) \
70  { \
71  pNnPiaCommonTrace->WriteCaption(); \
72  nn::pia::common::StringStream nnPiaCommonStringStream; \
73  (nnPiaCommonStringStream) << ARGS << NN_PIA_T("\n"); \
74  pNnPiaCommonTrace->Write(nnPiaCommonStringStream.CStr()); \
75  } \
76  } \
77  \
78 }
79 //! @endcond
80 
81 /*!
82 @cond PRIVATE
83 @brief Adds the function name to the trace output.
84 */
85 #define PIA_TRACE_EX(FLAG, ...) \
86  \
87 { \
88  nn::pia::common::Trace* pNnPiaCommonTrace = nn::pia::common::Trace::GetInstance(); \
89  if (pNnPiaCommonTrace) \
90  { \
91  if (pNnPiaCommonTrace->IsFlagSet(FLAG)) \
92  { \
93  pNnPiaCommonTrace->WriteCaption(); \
94  pNnPiaCommonTrace->Write("%s %s:", PIA_CODE_POSITION_FILE, PIA_CODE_POSITION_FUNC); \
95  pNnPiaCommonTrace->Write(__VA_ARGS__); \
96  pNnPiaCommonTrace->Write("\n"); \
97  } \
98  } \
99  \
100 }
101 //! @endcond
102 
103 
104 #else // else of NN_PIA_ENABLE_TRACE
105 
106 #define PIA_TRACE(FLAG, ...) (void)(FLAG)
107 #define PIA_BOOL_TO_TEXT(VALUE)
108 #define PIA_TRACE_STREAM(FLAG, ARGS) \
109  { \
110  nn::pia::common::EmptyStream(FLAG) << ARGS; \
111  }
112 #define PIA_TRACE_EX(FLAG, ...) (void)(FLAG)
113 
114 #endif // end of NN_PIA_ENABLE_TRACE
115 
116 //n1589: 8-bit assignment is made for each module. We may adjust this if it proves insufficient.
117 /*!
118 @brief Defines the tracing flag type.
119 
120 @details Use by passing it as the first argument to the <tt>PIA_TRACE</tt> macro.
121 */
122 
123 typedef u64 TraceFlag;
124 
125 /*!
126 @name TraceFlag
127 @anchor TraceFlag
128  @{
129 */
130 static const TraceFlag TRACE_FLAG_NEVER = 0LL; //!< The flag indicating that this is never displayed.
131 static const TraceFlag TRACE_FLAG_ALWAYS = 1LL << 0; //!< The flag indicating that this is always displayed.
132 
133 static const TraceFlag TRACE_FLAG_COMMON = 1LL << 1; //!< Flag for tracing the <tt>PiaCommon</tt> module.
134 static const TraceFlag TRACE_FLAG_COMMON_EVENT = 1LL << 2; //!< Flag for tracing events in the <tt>PiaCommon</tt> module.
135 static const TraceFlag TRACE_FLAG_COMMON_JOB = 1LL << 3; //!< Flag for tracing jobs in the <tt>PiaCommon</tt> module.
136 
137 static const TraceFlag TRACE_FLAG_LOCAL = 1LL << 5; //!< Flag for tracing the <tt>PiaLocal</tt> module.
138 static const TraceFlag TRACE_FLAG_LOCAL_TRANSPORT = 1LL << 6; //!< Flag for tracing sending and receiving in the <tt>PiaLocal</tt> module.
139 static const TraceFlag TRACE_FLAG_LOCAL_MIGRATION = 1LL << 7; //!< Flag for tracing host migration in the <tt>PiaLocal</tt> module.
140 
141 static const TraceFlag TRACE_FLAG_INET = 1LL << 9; //!< Flag for tracing the <tt>PiaInet</tt> module.
142 static const TraceFlag TRACE_FLAG_INET_INIT = 1LL << 10; //!< Flag for tracing initialization and finalization in the <tt>PiaInet</tt> module.
143 static const TraceFlag TRACE_FLAG_INET_SOCKET = 1LL << 11; //!< Flag for tracing sockets in the <tt>PiaInet</tt> module.
144 static const TraceFlag TRACE_FLAG_INET_SOCKET_DETAIL = 1LL << 12; //!< Flag for verbose tracing of sockets in the <tt>PiaInet</tt> module.
145 static const TraceFlag TRACE_FLAG_INET_SOCKET_SEND = 1LL << 13; //!< Flag for tracing send operations in the <tt>PiaInet</tt> module.
146 static const TraceFlag TRACE_FLAG_INET_SOCKET_RECEIVE = 1LL << 14; //!< Flag for tracing receive operations in the <tt>PiaInet</tt> module.
147 static const TraceFlag TRACE_FLAG_INET_NAT = 1LL << 15; //!< Flag for tracing NAT traversal by the <tt>PiaInet</tt> module.
148 static const TraceFlag TRACE_FLAG_INET_NAT_DETAIL = 1LL << 16; //!< Flag for verbose tracing of NAT traversal by the <tt>PiaInet</tt> module.
149 static const TraceFlag TRACE_FLAG_INET_NAT_PROBE = 1LL << 17; //!< Flag for verbose tracing of NAT traversal by the <tt>PiaInet</tt> module.
150 static const TraceFlag TRACE_FLAG_INET_GATEWAY = 1LL << 18; //!< Flag for tracing gateway services in the <tt>PiaInet</tt> module. (There are no plans to put gateway services into production.)
151 
152 static const TraceFlag TRACE_FLAG_TRANSPORT = 1LL << 19; //!< Flag for tracing the <tt>PiaTransport</tt> module.
153 static const TraceFlag TRACE_FLAG_TRANSPORT_INIT = 1LL << 20; //!< Flag for tracing initialization and finalization in the <tt>PiaTransport</tt> module.
154 static const TraceFlag TRACE_FLAG_TRANSPORT_KEEP_ALIVE = 1LL << 21; //!< Flag for tracing keep-alives in the <tt>PiaTransport</tt> module.
155 static const TraceFlag TRACE_FLAG_TRANSPORT_RTT = 1LL << 22; //!< Flag for tracing the round-trip time (RTT) protocol in the <tt>PiaTransport</tt> module.
156 static const TraceFlag TRACE_FLAG_TRANSPORT_BUFFER = 1LL << 23; //!< Flag for tracing buffers in the <tt>PiaTransport</tt> module.
157 static const TraceFlag TRACE_FLAG_TRANSPORT_PACKET_SEND = 1LL << 24; //!< Flag for tracing packet sending in the <tt>PiaTransport</tt> module.
158 static const TraceFlag TRACE_FLAG_TRANSPORT_PACKET_RECEIVE = 1LL << 25; //!< Flag for tracing packet reception in the <tt>PiaTransport</tt> module.
159 static const TraceFlag TRACE_FLAG_TRANSPORT_PROTOCOLMESSAGE_SEND = 1LL << 26; //!< Flag for tracing <tt>ProtocolMessage</tt> sending in the <tt>PiaTransport</tt> module.
160 static const TraceFlag TRACE_FLAG_TRANSPORT_PROTOCOLMESSAGE_RECEIVE = 1LL << 27; //!< Flag for tracing <tt>ProtocolMessage</tt> reception in the <tt>PiaTransport</tt> module.
161 static const TraceFlag TRACE_FLAG_TRANSPORT_RELAY = 1LL << 28; //!< Flag for tracing the relay feature of the <tt>PiaTransport</tt> module.
162 static const TraceFlag TRACE_FLAG_TRANSPORT_RELAY_DETAIL = 1LL << 29; //!< Flag for tracing the details of the relay feature in the <tt>PiaTransport</tt> module.
163 
164 static const TraceFlag TRACE_FLAG_SESSION = 1LL << 30; //!< Flag for tracing the <tt>PiaSession</tt> module.
165 static const TraceFlag TRACE_FLAG_SESSION_CONNECT = 1LL << 31; //!< Flag for tracing connections in the <tt>PiaSession</tt> module.
166 static const TraceFlag TRACE_FLAG_SESSION_LEAVE = 1LL << 32; //!< Flag for tracing disconnections in the <tt>PiaSession</tt> module.
167 static const TraceFlag TRACE_FLAG_SESSION_UPDATE = 1LL << 33; //!< Flag for tracing updates in the <tt>PiaSession</tt> module.
168 static const TraceFlag TRACE_FLAG_SESSION_MIGRATION = 1LL << 34; //!< Flag for tracing host migration in the <tt>PiaSession</tt> module.
169 static const TraceFlag TRACE_FLAG_SESSION_INIT = 1LL << 36; //!< Flag for tracing initialization and finalization in the <tt>PiaSession</tt> module.
170 static const TraceFlag TRACE_FLAG_SESSION_JOINT = 1LL << 37; //!< Flag for tracing joint sessions in the <tt>PiaSession</tt> module.
171 
172 static const TraceFlag TRACE_FLAG_SYNC = 1LL << 39; //!< Flag for tracing the <tt>PiaSync</tt> module.
173 
174 static const TraceFlag TRACE_FLAG_CLONE = 1LL << 41; //!< Flag for tracing the <tt>PiaClone</tt> module.
175 
176 static const TraceFlag TRACE_FLAG_RECKONING = 1LL << 43; //!< Flag for tracing the <tt>PiaReckoning</tt> module.
177 
178 static const TraceFlag TRACE_FLAG_CHAT = 1LL << 45; //!< Flag for tracing the <tt>PiaChat</tt> module.
179 
180 static const TraceFlag TRACE_FLAG_UTIL = 1LL << 47; //!< Flag for tracing the <tt>PiaUtil</tt> module.
181 
182 static const TraceFlag TRACE_FLAG_SERVICE = 1LL << 49; //!< Flag for tracing the <tt>PiaService</tt> module.
183 static const TraceFlag TRACE_FLAG_SERVICE_TRANSPORT = 1LL << 50; //!< Flag for tracing the <tt>PiaService</tt> module.
184 static const TraceFlag TRACE_FLAG_SERVICE_TRANSPORT_DETAIL = 1LL << 51; //!< Flag for tracing the <tt>PiaService</tt> module.
185 static const TraceFlag TRACE_FLAG_SERVICE_RELAY_SERVER = 1LL << 52; //!< Flag for tracing the <tt>PiaService</tt> module.
186 
187 static const TraceFlag TRACE_FLAG_BRAIN = 1LL << 54; //!< Flag for tracing the <tt>PiaBrain</tt> module.
188 static const TraceFlag TRACE_FLAG_BRAIN_DETAIL = 1LL << 55; //!< Flag for tracing the <tt>PiaBrain</tt> module.
189 
190 static const TraceFlag TRACE_FLAG_ALL = TRACE_FLAG_ALWAYS; //!< Flag for tracing everything.
191 
192 static const TraceFlag TRACE_FLAG_DEFAULT = TRACE_FLAG_ALWAYS; //!< The default value for <tt>TraceFlag</tt>.
193 
194 /*!
195 end of name TraceFlag
196  @}
197 */
198 
199 
200 /*!
201 @brief This class is the trace class.
202 
203 @details Trace code is disabled in release builds.
204 
205 @date 2014-09-18 Changed the specifications so that <tt>ResultAlreadyExists</tt> is returned if you call <tt>CreateInstance()</tt> when an instance already exists.
206 @date 2013-11-21 Reorganized the trace flags. The bit positions of the flags are now different from what they were before.
207 @date 2013-07-18 Changed the operations of <tt>IsFlagSet</tt>. The function now returns <tt>true</tt> if multiple flags are specified and any of the flags are raised.
208 @date 2012-06-07 <tt>TraceFlag</tt> and its value were changed from enumerated to <tt>u64</tt> constants.
209 @date 2012-05-30 Times can now also be printed.
210 @date 2012-04-19 Initial version.
211 */
213 {
214 public:
215 /*!
216 @brief Creates the <tt>Trace</tt> class instance (singleton pattern).
217 
218 @details Call this member function after calling <tt>nn::pia::common::BeginSetup</tt>, but before calling <tt>nn::pia::common::EndSetup</tt>.
219 
220 @return Returns a <tt>Result</tt> value that indicates success if the instance is created successfully. You must make sure that the implementation of this function in your application does not return any errors.
221 
222 @retval ResultAlreadyExists Indicates that an instance has already been created. Programming error. Fix your program so that this error is not returned.
223 @retval ResultNotInitialized The <tt>common</tt> module has not been initialized. Programming error. Fix your program so that this error is not returned.
224 @retval ResultInvalidState Indicates that the function was not called between the <tt>BeginSetup</tt> and <tt>EndSetup</tt> functions. Programming error. Fix your program so that this error is not returned.
225 
226 */
227  static nn::Result CreateInstance(void);
228 
229 
230 /*!
231 @brief Destroys the <tt>Trace</tt> class instance (singleton pattern).
232 
233 @details Destroys the <tt>Trace</tt> class instance.
234 This function returns without performing any action if it is called before an instance has been created.
235 */
236  static void DestroyInstance(void);
237 
238 
239 /*!
240 @brief Gets the <tt>Trace</tt> class instance (singleton pattern).
241 
242 @details Returns a <tt>NULL</tt> pointer if the instance has not yet been created using the <tt>CreateInstance()</tt> function.
243 
244 @return Returns a pointer to the <tt>Trace</tt> instance.
245 
246 */
247  static Trace* GetInstance(void)
248  {
249  return s_pInstance;
250  }
251 
252  //n1589: Optimized code for checking <tt>IsFlagSet</tt>.
253 /*!
254 @cond PRIVATE
255 */
256  static bool IsFlagSetStatic(u64 flag)
257  {
258 #if NN_PIA_ENABLE_TRACE
259  if (Trace::GetInstance() == NULL)
260  {
261  return false;
262  }
263 
264  return Trace::GetInstance()->IsFlagSet(flag);
265 #else
266  NN_PIA_DUMMY_PARAM(flag);
267  return false;
268 #endif
269  }
270  //! @endcond
271 
272 /*!
273 @cond PRIVATE
274 @brief Outputs a string.
275 Do not call this directly. It is called from a macro.
276 */
277  void Write(const char* pFmt, ...);
278  //! @endcond
279 
280 
281 /*!
282 @cond PRIVATE
283 @brief Outputs a caption string.
284 Do not call this directly. It is called from a macro.
285 */
286  void WriteCaption();
287  //! @endcond
288 
289 /*!
290 @brief Enables trace flags.
291 
292 @details Use this method to enable additional trace flags.
293 
294 @param[in] flags Specifies the bitwise OR of the <tt>@ref TraceFlag</tt> values to enable.
295 */
296  void SetFlag(u64 flags)
297  {
298  m_flags |= flags;
299  }
300 
301 /*!
302 @brief Disables the specified trace flags.
303 
304 @details Disables the specified trace flags.
305 However, <tt>TRACE_FLAG_ALWAYS</tt> is excluded.
306 
307 @param[in] flags Specifies the bitwise OR of the <tt>@ref TraceFlag</tt> values to disable.
308 */
309  void ClearFlag(u64 flags)
310  {
311  m_flags = m_flags & (~flags);
312  }
313 
314 /*!
315 @brief Indicates whether the specified flags are set.
316 
317 @details The result of <tt>IsFlagSet(TRACE_NEVER)</tt> is <tt>true</tt>.
318 Returns <tt>true</tt> if any of the specified flags are raised when multiple flags have been specified by argument.
319 
320 @return Returns <tt>true</tt> if the particular flag is set, and <tt>false</tt> if not.
321 
322 @param[in] flag Specifies the trace flags to query.
323 
324 */
325  bool IsFlagSet(u64 flag) const
326  {
327 #if NN_PIA_ENABLE_TRACE
328  return (m_flags & flag) != 0;
329 #else
330  NN_PIA_DUMMY_PARAM(flag);
331  return false;
332 #endif
333  }
334 
335 /*!
336 @brief Clears all trace flags, except for <tt>TRACE_FLAG_ALWAYS</tt>.
337 */
338  void ClearFlag(void)
339  {
340  m_flags = TRACE_FLAG_DEFAULT;
341  }
342 
343 
344 /*!
345 @brief Enables and disables the time display.
346 When enabled, it displays the time passed from the base time in units of milliseconds, such as "[Pia:12345]..."
347 @param[in] isPrint Specify <tt>true</tt> to display the time.
348 */
349  void SetPrintTime(bool isPrint)
350  {
351  m_IsPrintTime = isPrint;
352  }
353 
354 
355 /*!
356 @brief Gets whether time display is enabled or disabled.
357 @return Returns <tt>true</tt> if times are printed.
358 */
359  bool IsPrintTime() const
360  {
361  return m_IsPrintTime;
362  }
363 
364 
365 /*!
366 @brief Resets the base time for the time display to the current time.
367 */
369  {
370  m_BaseTime.SetNow();
371  }
372 
373 private:
374 /*!
375 @brief The constructor. Only the <tt>TRACE_FLAG_ALWAYS</tt> flag is set.
376 */
377  Trace();
378 
379 /*!
380 @brief Destructor.
381 */
382  ~Trace(void)
383  {
384  }
385 
386 
387 /*!
388 @brief This copy constructor is private.
389 */
390  Trace(const Trace&);
391 
392 /*!
393 @brief This assignment operator is private.
394 */
395  Trace& operator=(const Trace&);
396 
397  u64 m_flags;
398  Time m_BaseTime;
399  bool m_IsPrintTime;
400 
401  static Trace* s_pInstance;
402 };
403 }
404 }
405 } // end of namespace nn::pia::common
static const TraceFlag TRACE_FLAG_BRAIN_DETAIL
Flag for tracing the PiaBrain module.
Definition: common_Trace.h:188
static const TraceFlag TRACE_FLAG_TRANSPORT_PACKET_SEND
Flag for tracing packet sending in the PiaTransport module.
Definition: common_Trace.h:157
static const TraceFlag TRACE_FLAG_SESSION_MIGRATION
Flag for tracing host migration in the PiaSession module.
Definition: common_Trace.h:168
static const TraceFlag TRACE_FLAG_TRANSPORT_INIT
Flag for tracing initialization and finalization in the PiaTransport module.
Definition: common_Trace.h:153
static void DestroyInstance(void)
Destroys the Trace class instance (singleton pattern).
void ResetBaseTime()
Resets the base time for the time display to the current time.
Definition: common_Trace.h:368
static const TraceFlag TRACE_FLAG_ALL
Flag for tracing everything.
Definition: common_Trace.h:190
static const TraceFlag TRACE_FLAG_TRANSPORT_PROTOCOLMESSAGE_SEND
Flag for tracing ProtocolMessage sending in the PiaTransport module.
Definition: common_Trace.h:159
static const TraceFlag TRACE_FLAG_SESSION_CONNECT
Flag for tracing connections in the PiaSession module.
Definition: common_Trace.h:165
static const TraceFlag TRACE_FLAG_INET
Flag for tracing the PiaInet module.
Definition: common_Trace.h:141
Class that represents time.
Definition: common_Time.h:39
static const TraceFlag TRACE_FLAG_SESSION_INIT
Flag for tracing initialization and finalization in the PiaSession module.
Definition: common_Trace.h:169
void ClearFlag(void)
Clears all trace flags, except for TRACE_FLAG_ALWAYS.
Definition: common_Trace.h:338
static const TraceFlag TRACE_FLAG_LOCAL_TRANSPORT
Flag for tracing sending and receiving in the PiaLocal module.
Definition: common_Trace.h:138
static const TraceFlag TRACE_FLAG_INET_NAT_PROBE
Flag for verbose tracing of NAT traversal by the PiaInet module.
Definition: common_Trace.h:149
Definition: assert.h:115
static const TraceFlag TRACE_FLAG_TRANSPORT_RTT
Flag for tracing the round-trip time (RTT) protocol in the PiaTransport module.
Definition: common_Trace.h:155
This class is the trace class.
Definition: common_Trace.h:212
static const TraceFlag TRACE_FLAG_TRANSPORT_PROTOCOLMESSAGE_RECEIVE
Flag for tracing ProtocolMessage reception in the PiaTransport module.
Definition: common_Trace.h:160
static const TraceFlag TRACE_FLAG_INET_SOCKET
Flag for tracing sockets in the PiaInet module.
Definition: common_Trace.h:143
static const TraceFlag TRACE_FLAG_TRANSPORT_RELAY_DETAIL
Flag for tracing the details of the relay feature in the PiaTransport module.
Definition: common_Trace.h:162
static const TraceFlag TRACE_FLAG_SYNC
Flag for tracing the PiaSync module.
Definition: common_Trace.h:172
static const TraceFlag TRACE_FLAG_UTIL
Flag for tracing the PiaUtil module.
Definition: common_Trace.h:180
static const TraceFlag TRACE_FLAG_SERVICE_RELAY_SERVER
Flag for tracing the PiaService module.
Definition: common_Trace.h:185
void SetFlag(u64 flags)
Enables trace flags.
Definition: common_Trace.h:296
static const TraceFlag TRACE_FLAG_COMMON_JOB
Flag for tracing jobs in the PiaCommon module.
Definition: common_Trace.h:135
static const TraceFlag TRACE_FLAG_SESSION
Flag for tracing the PiaSession module.
Definition: common_Trace.h:164
static const TraceFlag TRACE_FLAG_NEVER
The flag indicating that this is never displayed.
Definition: common_Trace.h:130
static const TraceFlag TRACE_FLAG_TRANSPORT
Flag for tracing the PiaTransport module.
Definition: common_Trace.h:152
static const TraceFlag TRACE_FLAG_INET_NAT
Flag for tracing NAT traversal by the PiaInet module.
Definition: common_Trace.h:147
static const TraceFlag TRACE_FLAG_COMMON
Flag for tracing the PiaCommon module.
Definition: common_Trace.h:133
static const TraceFlag TRACE_FLAG_RECKONING
Flag for tracing the PiaReckoning module.
Definition: common_Trace.h:176
static const TraceFlag TRACE_FLAG_INET_SOCKET_SEND
Flag for tracing send operations in the PiaInet module.
Definition: common_Trace.h:145
static const TraceFlag TRACE_FLAG_SERVICE_TRANSPORT_DETAIL
Flag for tracing the PiaService module.
Definition: common_Trace.h:184
static nn::Result CreateInstance(void)
Creates the Trace class instance (singleton pattern).
static const TraceFlag TRACE_FLAG_TRANSPORT_PACKET_RECEIVE
Flag for tracing packet reception in the PiaTransport module.
Definition: common_Trace.h:158
static const TraceFlag TRACE_FLAG_TRANSPORT_KEEP_ALIVE
Flag for tracing keep-alives in the PiaTransport module.
Definition: common_Trace.h:154
static const TraceFlag TRACE_FLAG_COMMON_EVENT
Flag for tracing events in the PiaCommon module.
Definition: common_Trace.h:134
void SetNow()
Makes this object represent the current time.
static const TraceFlag TRACE_FLAG_DEFAULT
The default value for TraceFlag.
Definition: common_Trace.h:192
void SetPrintTime(bool isPrint)
Enables and disables the time display. When enabled, it displays the time passed from the base time i...
Definition: common_Trace.h:349
bool IsFlagSet(u64 flag) const
Indicates whether the specified flags are set.
Definition: common_Trace.h:325
static const TraceFlag TRACE_FLAG_LOCAL
Flag for tracing the PiaLocal module.
Definition: common_Trace.h:137
static Trace * GetInstance(void)
Gets the Trace class instance (singleton pattern).
Definition: common_Trace.h:247
void ClearFlag(u64 flags)
Disables the specified trace flags.
Definition: common_Trace.h:309
static const TraceFlag TRACE_FLAG_CHAT
Flag for tracing the PiaChat module.
Definition: common_Trace.h:178
static const TraceFlag TRACE_FLAG_SESSION_LEAVE
Flag for tracing disconnections in the PiaSession module.
Definition: common_Trace.h:166
u64 TraceFlag
Defines the tracing flag type.
Definition: common_Trace.h:123
static const TraceFlag TRACE_FLAG_CLONE
Flag for tracing the PiaClone module.
Definition: common_Trace.h:174
bool IsPrintTime() const
Gets whether time display is enabled or disabled.
Definition: common_Trace.h:359
static const TraceFlag TRACE_FLAG_LOCAL_MIGRATION
Flag for tracing host migration in the PiaLocal module.
Definition: common_Trace.h:139
static const TraceFlag TRACE_FLAG_TRANSPORT_BUFFER
Flag for tracing buffers in the PiaTransport module.
Definition: common_Trace.h:156
static const TraceFlag TRACE_FLAG_INET_SOCKET_RECEIVE
Flag for tracing receive operations in the PiaInet module.
Definition: common_Trace.h:146
static const TraceFlag TRACE_FLAG_TRANSPORT_RELAY
Flag for tracing the relay feature of the PiaTransport module.
Definition: common_Trace.h:161
static const TraceFlag TRACE_FLAG_INET_SOCKET_DETAIL
Flag for verbose tracing of sockets in the PiaInet module.
Definition: common_Trace.h:144
static const TraceFlag TRACE_FLAG_INET_NAT_DETAIL
Flag for verbose tracing of NAT traversal by the PiaInet module.
Definition: common_Trace.h:148
static const TraceFlag TRACE_FLAG_INET_INIT
Flag for tracing initialization and finalization in the PiaInet module.
Definition: common_Trace.h:142
static const TraceFlag TRACE_FLAG_BRAIN
Flag for tracing the PiaBrain module.
Definition: common_Trace.h:187
static const TraceFlag TRACE_FLAG_SERVICE_TRANSPORT
Flag for tracing the PiaService module.
Definition: common_Trace.h:183
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40
static const TraceFlag TRACE_FLAG_SESSION_JOINT
Flag for tracing joint sessions in the PiaSession module.
Definition: common_Trace.h:170
static const TraceFlag TRACE_FLAG_ALWAYS
The flag indicating that this is always displayed.
Definition: common_Trace.h:131
static const TraceFlag TRACE_FLAG_SESSION_UPDATE
Flag for tracing updates in the PiaSession module.
Definition: common_Trace.h:167
static const TraceFlag TRACE_FLAG_INET_GATEWAY
Flag for tracing gateway services in the PiaInet module. (There are no plans to put gateway services ...
Definition: common_Trace.h:150
static const TraceFlag TRACE_FLAG_SERVICE
Flag for tracing the PiaService module.
Definition: common_Trace.h:182