CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
transport_StationConnectionInfo.h
1 /*--------------------------------------------------------------------------------*
2  Copyright (C)Nintendo All rights reserved.
3 
4  These coded instructions, statements, and computer programs contain proprietary
5  information of Nintendo and/or its licensed developers and are protected by
6  national and international copyright laws. They may not be disclosed to third
7  parties or copied or duplicated in any form, in whole or in part, without the
8  prior written consent of Nintendo.
9 
10  The content herein is highly confidential and should be handled accordingly.
11  *--------------------------------------------------------------------------------*/
12 
13 
14 #pragma once
15 
16 #include <nn/pia/transport/transport_Definitions.h>
17 #include <nn/pia/transport/transport_StationLocation.h>
18 
19 namespace nn
20 {
21 namespace pia
22 {
23 namespace transport
24 {
25 
26 /*!
27  @brief ステーションを一意に識別するためのアドレスです。
28 
29  @details メインアドレスとサブアドレスの2つの StationLocation を持ちます。
30  <br>
31  */
33 {
34 public:
35  /*!
36  @brief コンストラクタです。
37  */
39 
40  /*!
41  @brief コピーコンストラクタです。
42  @param[in] o コピーコンストラクタの引数です。
43  */
45 
46  /*!
47  @brief デストラクタです。
48  */
49  virtual ~StationConnectionInfo(void);
50 
51  void SetStationConnectionInfo(const StationConnectionInfo& o);
52 
53  /*!
54  @brief 代入演算子です。
55 
56  @param[in] o 代入する StationConnectionInfo オブジェクトを指定します。
57  @return 本オブジェクトの参照が返ります。
58  */
60 
61  bool operator==(const StationConnectionInfo& o) const;
62 
63  bool operator!=(const StationConnectionInfo& o) const
64  {
65  return !(*this == o);
66  }
67 
68  bool HasPrivateAddress() const
69  {
70  return m_SubLocation.GetStationAddress().GetInetAddress().IsValid();
71  }
72 
73  bool IsSamePublicAddress(const StationConnectionInfo& o) const
74  {
75  return m_MainLocation.IsSameAddress(o.m_MainLocation);
76  }
77 
78  /*!
79  @brief StationLocation (メインアドレス)の const 参照を得ます。
80 
81  @return StationLocation (メインアドレス)の const 参照が返ります。
82  */
83  const StationLocation& GetMainLocation(void) const
84  {
85  return m_MainLocation;
86  }
87 
88  /*!
89  @brief StationLocation (メインアドレス)の参照を得ます。
90 
91  @return StationLocation (メインアドレス)の参照が返ります。
92  */
94  {
95  return m_MainLocation;
96  }
97 
98  /*!
99  @brief StationLocation (メインアドレス)を設定します。
100 
101  @param[in] o 設定する StationLocation 。
102  */
104  {
105  m_MainLocation.SetStationLocation(o);
106  }
107 
108  /*!
109  @brief StationLocation (サブアドレス)の const 参照を得ます。
110 
111  @return StationLocation (サブアドレス)の const 参照が返ります。
112  */
113  const StationLocation& GetSubLocation(void) const
114  {
115  return m_SubLocation;
116  }
117 
118  /*!
119  @brief StationLocation (サブアドレス)の参照を得ます。
120 
121  @return StationLocation (サブアドレス)の参照が返ります。
122  */
124  {
125  return m_SubLocation;
126  }
127 
128  /*!
129  @brief StationLocation (サブアドレス)を設定します。
130 
131  @param[in] o 設定する StationLocation 。
132  */
134  {
135  m_SubLocation.SetStationLocation(o);
136  }
137 
138  /*!
139  @brief StationLocation (メインアドレス)の const 参照を得ます。
140  メインアドレスがパブリックアドレスのときに使用されることを想定しています。
141 
142  @return StationLocation (メインアドレス)の const 参照が返ります。
143  */
145  {
146  return m_MainLocation;
147  }
148 
149  /*!
150  @brief StationLocation (メインアドレス)の参照を得ます。
151  メインアドレスがパブリックアドレスのときに使用されることを想定しています。
152 
153  @return StationLocation (メインアドレス)の参照が返ります。
154  */
156  {
157  return m_MainLocation;
158  }
159 
160  /*!
161  @brief StationLocation (サブアドレス)の const 参照を得ます。
162  サブアドレスがプライベートアドレスのときに使用されることを想定しています。
163 
164  @return StationLocation (サブアドレス)の const 参照が返ります。
165  */
167  {
168  return m_SubLocation;
169  }
170 
171  /*!
172  @brief StationLocation (サブアドレス)の参照を得ます。
173  サブアドレスがプライベートアドレスのときに使用されることを想定しています。
174 
175  @return StationLocation (サブアドレス)の参照が返ります。
176  */
178  {
179  return m_SubLocation;
180  }
181 
182  virtual uint32_t GetSerializedSize(void) const;
183  virtual Result Serialize(uint8_t* pBuffer, uint32_t* pSerializedSize, uint32_t bufferSize) const;
184  virtual Result Deserialize(const uint8_t* pData);
185 
186  virtual uint32_t GetStreamlinedSerializedSize(void) const;
187  virtual Result StreamlinedSerialize(uint8_t* pBuffer, uint32_t* pSerializedSize, uint32_t bufferSize) const;
188  virtual Result StreamlinedDeserialize(const uint8_t* pData);
189 
190  /*!
191  @brief デバッグに有用な情報をプリントします。
192 
193  @param[in] flag トレースフラグの論理和。詳細は@ref TraceFlag 型を参照してください。
194  */
195  virtual void Trace(uint64_t flag) const;
196 
197 private:
198  uint32_t LittleMembersSerialize(uint8_t* pBuffer, const StationLocation& src) const;
199  uint32_t LittleMembersDeserialize(StationLocation* pDest, const uint8_t* pData);
200 
201  StationLocation m_MainLocation;
202  StationLocation m_SubLocation;
203 };
204 }
205 }
206 }