CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
transport_StationLocation.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/common/common_StationAddress.h>
18 
19 namespace nn
20 {
21 namespace pia
22 {
23 namespace inet
24 {
25 class NexFacade;
26 }
27 }
28 }
29 
30 namespace nn
31 {
32 namespace pia
33 {
34 namespace transport
35 {
36 
37 // 先行宣言
38 class StationConnectionInfo;
39 
40 /*!
41  @brief ステーションを一意に識別するためのアドレスです。
42 
43  */
45 {
46  friend class StationConnectionInfo;
47 
48 public:
49  /*!
50  @brief コンストラクタです。
51  */
52  StationLocation(void);
53 
54 
55  /*!
56  @brief コピーコンストラクタです。
57  */
59 
60 
61  /*!
62  @brief デストラクタです。
63  */
64  virtual ~StationLocation(void);
65 
66  void SetStationLocation(const StationLocation& o);
67 
68  /*!
69  @brief 代入演算子です。
70 
71  @return 本オブジェクトの参照が返ります。
72  */
74 
75  bool operator==(const StationLocation& o) const;
76 
77  bool operator!=(const StationLocation& o) const
78  {
79  return !(*this == o);
80  }
81 
82  bool IsSameAddress(const StationLocation& o) const
83  {
84  return m_Address.GetInetAddress().GetAddress() == o.m_Address.GetInetAddress().GetAddress();
85  }
86 
87  bool IsSameServerCId(const StationLocation& o) const
88  {
89  return (m_ServiceConnectionId == o.m_ServiceConnectionId);
90  }
91 
92  bool IsSameConnectionId(const StationLocation& o) const
93  {
94  return (m_NexConnectionId == o.m_NexConnectionId);
95  }
96 
97  /*!
98 
99  @brief nn::pia::common::StationAddress の const 参照を得ます。
100 
101  @return nn::pia::common::StationAddress の const 参照が返ります。
102  */
104  {
105  return m_Address;
106  }
107 
108  /*!
109  @brief nn::pia::common::StationAddress の参照を得ます。
110 
111  @return nn::pia::common::StationAddress の参照が返ります。
112  */
114  {
115  return m_Address;
116  }
117 
118  /*!
119  @brief nn::pia::common::StationAddress を設定します。
120 
121  @param[in] addr 設定するインターネットアドレス。
122  */
124 
125  virtual uint32_t GetSerializedSize(void) const;
126  virtual Result Serialize(uint8_t* pBuffer, uint32_t* pSerializedSize, uint32_t bufferSize) const;
127  virtual Result Deserialize(const uint8_t* pData);
128 
129  void SetNexServerConnectionId(uint32_t o)
130  {
131  m_ServiceConnectionId = o;
132  }
133 
134  uint32_t GetNexServerConnectionId() const
135  {
136  return m_ServiceConnectionId;
137  }
138 
139  void SetNexUrlType(uint8_t o)
140  {
141  m_NexUrlType = o;
142  }
143 
144  uint8_t GetNexUrlType() const
145  {
146  return m_NexUrlType;
147  }
148 
149  void SetProbeRequestInitiation(uint8_t o)
150  {
151  m_IsProbeRequestInitiation = o;
152  }
153 
154  uint8_t IsProbeRequestInitiation() const
155  {
156  return m_IsProbeRequestInitiation;
157  }
158 
159  void SetNatTypeFlag(uint8_t flags)
160  {
161  m_NatTypeFlags = flags;
162  }
163 
164  uint8_t GetNatTypeFlag() const
165  {
166  return m_NatTypeFlags;
167  }
168 
169  bool IsNatTypeFlagSet(uint8_t flag) const
170  {
171  return (m_NatTypeFlags & flag) == flag;
172  }
173 
174  void GetLocationString(common::String* pString) const;
175 
176  void SetPrincipalId(PrincipalId principalId)
177  {
178  m_NexPrincipalId = principalId;
179  }
180 
181  PrincipalId GetPrincipalId() const
182  {
183  return m_NexPrincipalId;
184  }
185 
186  void SetNatMapping(uint8_t o)
187  {
188  m_NatMapping = o;
189  }
190 
191  uint8_t GetNatMapping() const
192  {
193  return m_NatMapping;
194  }
195 
196  void SetNatFiltering(uint8_t o)
197  {
198  m_NatFiltering = o;
199  }
200 
201  uint8_t GetNatFiltering() const
202  {
203  return m_NatFiltering;
204  }
205 
206  void SetNexConnectionId(uint32_t o)
207  {
208  m_NexConnectionId = o;
209  }
210 
211  uint32_t GetNexConnectionId() const
212  {
213  return m_NexConnectionId;
214  }
215 
216  void SetNexStreamId(uint8_t o)
217  {
218  m_NexStreamId = o;
219  }
220 
221  uint8_t GetNexStreamId() const
222  {
223  return m_NexStreamId;
224  }
225 
226  void SetNexStreamType(uint8_t o)
227  {
228  m_NexStreamType = o;
229  }
230 
231  uint8_t GetNexStreamType() const
232  {
233  return m_NexStreamType;
234  }
235 
236  void SetRelayServerAddress(const common::InetAddress& inetAddress)
237  {
238  m_RelayServerAddress = inetAddress;
239  }
240 
241  const common::InetAddress& GetRelayServerAddress() const
242  {
243  return m_RelayServerAddress;
244  }
245  common::InetAddress& GetRelayServerAddress()
246  {
247  return m_RelayServerAddress;
248  }
249 
250  /*!
251  @brief デバッグに有用な情報をプリントします。
252 
253  @param[in] flag トレースフラグの論理和。詳細は@ref TraceFlag 型を参照してください。
254  */
255  virtual void Trace(uint64_t flag) const;
256 
257 private:
258  common::StationAddress m_Address;
259 
260  //n1589:これらを別の型にすることでNEX依存を回避している
261  // nn::nex::PrincipalID
262  PrincipalId m_NexPrincipalId;
263  // nn::nex::ConnectionID
264  uint32_t m_NexConnectionId;
265  // nn::nex::ConnectionID
266  uint32_t m_ServiceConnectionId;
267 
268  // nn::nex::StationURL::URLType
269  uint8_t m_NexUrlType;
270  // nn::nex::Stream::ID
271  uint8_t m_NexStreamId;
272  // nn::nex::Stream::Type
273  uint8_t m_NexStreamType;
274 
275  // nn::nex::NATProperties::MappingProperties
276  uint8_t m_NatMapping;
277  // nn::nex::NATProperties::FilteringProperties
278  uint8_t m_NatFiltering;
279 
280  uint8_t m_NatTypeFlags;
281 
282  uint8_t m_IsProbeRequestInitiation;
283 
284  common::InetAddress m_RelayServerAddress;
285 };
286 }
287 }
288 }