CTR Pia  4.11.3
Game Communication Engine
transport_ConnectionAnalysisData.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: transport_ConnectionAnalysisData.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/transport/transport_definitions.h>
18 
19 
20 namespace nn
21 {
22 namespace pia
23 {
24 namespace transport
25 {
26 
27 
28 /*!
29  @brief The <tt>ConnectionAnalysisData</tt> structure contains parameters related to
30  the connection quality (such as the round-trip time (RTT) and the packet loss rate).
31 
32  @date 2013-11-22 Changed the type for the variables that count packets and packet losses from <tt>u16</tt> to <tt>u32</tt>.
33  @date 2013-11-14 Added a member variable that maintains a counter from the point at which measurement starts.
34  @date 2013-10-29 Initial version.
35  */
37 {
38  static const size_t MAX_ENTRIES = MAX_STATION_NUM;
39 
40 /*!
41  @brief Clears the member variables.
42 */
43  void Clear();
44 
45 
46 /*!
47  @brief Contains information required for tabulating analysis results for each <tt>Station</tt>.
48 */
49  struct Entry
50  {
51  s32 rtt; //!< RTT.
52 
53  u32 prevTotalPacketNum; //!< Previous number of packets.
54  u32 currTotalPacketNum; //!< Current number of packets.
55 
56  u32 prevPacketLossNum; //!< Previous number of packets lost.
57  u32 currPacketLossNum; //!< Current number of packets lost.
58 
59  bool valid; //!< Specifies <tt>true</tt> if this entry is valid.
60  };
61 
62  struct Entry entry[MAX_ENTRIES]; //!< Entry.
63  s32 passedMilliSec; //!< Time elapsed (in milliseconds).
64 
65 
66 /*!
67  @brief Outputs the data to the console (except in the Release build).
68 
69  @param[in] bDetail Set to <tt>true</tt> to also output data related to the internal implementation of Pia.
70 */
71  void Print(bool bDetail) const;
72 
73 
74 /*!
75  @brief Prints information that is useful for debugging.
76 
77  @param[in] flag Specifies the bitwise OR of trace flags. For more information, see the <tt>@ref TraceFlag</tt> API reference.
78 */
79  void Trace(u64 flag) const;
80 };
81 }
82 }
83 } // End of namespace nn::pia::transport.
The ConnectionAnalysisData structure contains parameters related to the connection quality (such as t...
Definition: transport_ConnectionAnalysisData.h:36
bool valid
Specifies true if this entry is valid.
Definition: transport_ConnectionAnalysisData.h:59
Definition: assert.h:115
u32 prevTotalPacketNum
Previous number of packets.
Definition: transport_ConnectionAnalysisData.h:53
u32 prevPacketLossNum
Previous number of packets lost.
Definition: transport_ConnectionAnalysisData.h:56
u32 currPacketLossNum
Current number of packets lost.
Definition: transport_ConnectionAnalysisData.h:57
void Trace(u64 flag) const
Prints information that is useful for debugging.
Contains information required for tabulating analysis results for each Station.
Definition: transport_ConnectionAnalysisData.h:49
const size_t MAX_STATION_NUM
The maximum value for the number of stations that can participate in a Pia session.
Definition: platformCtr.h:64
s32 rtt
RTT.
Definition: transport_ConnectionAnalysisData.h:51
void Clear()
Clears the member variables.
s32 passedMilliSec
Time elapsed (in milliseconds).
Definition: transport_ConnectionAnalysisData.h:63
void Print(bool bDetail) const
Outputs the data to the console (except in the Release build).
struct Entry entry[MAX_ENTRIES]
Entry.
Definition: transport_ConnectionAnalysisData.h:62
u32 currTotalPacketNum
Current number of packets.
Definition: transport_ConnectionAnalysisData.h:54