CTR Pia  4.11.3
Game Communication Engine
transport_ProtocolEvent.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: transport_ProtocolEvent.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 namespace nn
20 {
21 namespace pia
22 {
23 namespace transport
24 {
25 
26 
27 /*!
28 @cond PRIVATE
29 @brief Protocol event class.
30 */
31 class ProtocolEvent : public nn::pia::common::RootObject
32 {
33 public:
34 /*!
35 @brief The event type.
36 */
37  enum Type
38  {
39  CONNECT,
40  DISCONNECT
41  };
42 
43 
44 /*!
45 @brief Constructor.
46 */
47  ProtocolEvent(Type type, StationIndex stationId)
48  : m_Type(type), m_StationIndex(stationId)
49  {
50  }
51 
52 
53 /*!
54 @brief Gets the event type.
55 */
56  Type GetType() const
57  {
58  return m_Type;
59  }
60 
61 
62 /*!
63 @brief Gets the ID of the station.
64 */
65  StationIndex GetStationIndex() const
66  {
67  return m_StationIndex;
68  }
69 
70 
71 /*!
72 @brief Prints information useful for debugging.
73 
74 @param[in] flag Bitwise OR of trace flags. For more information, see the <tt>@ref TraceFlag</tt> type.
75 */
76  virtual void Trace(u64 flag) const;
77 
78 private:
79  Type m_Type;
80  StationIndex m_StationIndex;
81 };
82 //! @endcond
83 }
84 }
85 } // end of namespace nn::pia::transport
StationIndex
Enumerates StationIndex values.
Definition: platformCtr.h:44
Definition: assert.h:115
virtual void Trace(u64 flag) const
Prints information that is useful for debugging.
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40