CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
transport_NetworkFactory.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 
18 namespace nn
19 {
20 namespace pia
21 {
22 namespace common
23 {
24 class String;
25 class StepSequenceJob;
26 class IPacketInput;
27 class IPacketOutput;
28 class SignatureSetting;
29 class MonitoringDataSender;
30 }
31 }
32 } // end of namespace nn::pia::common
33 
34 namespace nn
35 {
36 namespace pia
37 {
38 namespace session
39 {
40 class SignatureSettingStorage;
41 class IMatchmakeSession;
42 class ISessionInfoList;
43 class MeshLayerController;
44 class ICommunityInfoList;
45 }
46 }
47 } // end of namespace nn::pia::session
48 
49 namespace nn
50 {
51 namespace pia
52 {
53 namespace transport
54 {
55 
56 class ConnectStationJob;
57 class DisconnectStationJob;
58 class PacketHandler;
59 class MissingStationHandler;
60 
61 /*!
62  @brief ネットワークに必要なクラスを生成するためのインタフェースです(ファクトリパターン)。
63  @details アプリケーションが本クラスのインスタンスを作成することはありません。 本クラスを継承したクラスを使用してください。
64 
65 @if CTR_DOC
66  @see nn::pia::local::UdsNetworkFactory
67 @endif
68 @if NIN_DOC
69  @see nn::pia::local::LdnNetworkFactory
70 @endif
71  @see nn::pia::inet::NexNetworkFactory
72  @see nn::pia::lan::LanNetworkFactory
73  */
75 {
76 public:
77  /*!
78  @cond PRIVATE
79  @brief 仮想デストラクタです。
80  */
81  virtual ~NetworkFactory(void)
82  {
83  }
84  //! @endcond
85 
86  /*!
87  @cond PRIVATE
88  @brief 最大参加可能ステーション数を返します。
89  */
90  virtual uint16_t GetMaxStationNum() const = 0;
91  //! @endcond
92 
93  virtual NetworkFactory* CreateSelf() = 0;
94 
95  /*!
96  @cond PRIVATE
97  @brief ConnectStationJob を生成します。
98  */
99  virtual ConnectStationJob* CreateConnectStationJob() = 0;
100  //! @endcond
101 
102 
103  /*!
104  @cond PRIVATE
105  @brief DisconnectStationJob を生成します。
106  */
107  virtual DisconnectStationJob* CreateDisconnectStationJob() = 0;
108  //! @endcond
109 
110 
111  /*!
112  @cond PRIVATE
113  @brief InputStream を生成します。
114  */
115  virtual common::IPacketInput* CreateInputStream() = 0;
116  //! @endcond
117 
118 
119  /*!
120  @cond PRIVATE
121  @brief CreateMeshJob を生成します。
122  */
123  virtual common::StepSequenceJob* CreateCreateMeshJob() = 0;
124  //! @endcond
125 
126 
127  /*!
128  @cond PRIVATE
129  @brief JoinMeshJob を生成します。
130  */
131  virtual common::StepSequenceJob* CreateJoinMeshJob() = 0;
132  //! @endcond
133 
134 
135  /*!
136  @cond PRIVATE
137  @brief LeaveMeshJob を生成します。
138  */
139  virtual common::StepSequenceJob* CreateLeaveMeshJob() = 0;
140  //! @endcond
141 
142 
143  /*!
144  @cond PRIVATE
145  @brief OutputStream を生成します。
146  */
147  virtual common::IPacketOutput* CreateOutputStream() = 0;
148  //! @endcond
149 
150 
151  /*!
152  @cond PRIVATE
153  @brief ProcessHostMigrationJob を生成します。
154  */
155  virtual common::StepSequenceJob* CreateProcessHostMigrationJob() = 0;
156  //! @endcond
157 
158 
159  /*!
160  @cond PRIVATE
161  @brief LeaveWithHostMigrationJob を生成します。
162  */
163  virtual common::StepSequenceJob* CreateLeaveWithHostMigrationJob() = 0;
164  //! @endcond
165 
166 
167  /*!
168  @cond PRIVATE
169  @brief KickoutManageJob を生成します。
170  */
171  virtual common::StepSequenceJob* CreateKickoutManageJob() = 0;
172  //! @endcond
173 
174 
175  /*!
176  @cond PRIVATE
177  @brief 必要なプロトコルを構築します。
178  */
179  virtual Result CreateProtocols()
180  {
181  return ResultSuccess();
182  }
183  //! @endcond
184 
185 
186  /*!
187  @cond PRIVATE
188  @brief PacketHandler の具象インスタンスを構築します。
189  */
190  virtual PacketHandler* CreatePacketHandler() = 0;
191  //! @endcond
192 
193 
194  /*!
195  @cond PRIVATE
196  @brief 署名が必要かどうか。
197  */
198  virtual bool IsSignatureRequired() const = 0;
199  //! @endcond
200 
201  /*!
202  @cond PRIVATE
203  @brief 署名鍵を保持するストレージを作成します。
204  */
205  virtual session::SignatureSettingStorage* CreateSignatureSettingStorage() = 0;
206  //! @endcond
207 
208  /*!
209  @cond PRIVATE
210  @brief 複数候補親交代の使用を許すかどうか。
211  */
212  virtual bool IsMultiCandidatePermitted() const
213  {
214  return false;
215  }
216  //! @endcond
217 
218  /*!
219  @cond PRIVATE
220  @brief リレー通信機能の使用を許すかどうか。
221  */
222  virtual bool IsRelayConnectionPermitted() const
223  {
224  return false;
225  }
226  //! @endcond
227 
228  virtual bool IsStarConnection() const
229  {
230  return false;
231  }
232 
233  virtual bool IsSupportedProtocol(uint16_t protocolType) const;
234 
235  /*!
236  @cond PRIVATE
237  @brief ジョイントセッション機能の使用を許すかどうか。
238  */
239  virtual bool IsJointSessionPermitted() const
240  {
241  return false;
242  }
243  //! @endcond
244 
245  /*!
246  @cond PRIVATE
247  @brief MonitoringDataSender 派生クラスのインスタンスを生成します。
248  */
249  virtual common::MonitoringDataSender* CreateMonitoringDataSender()
250  {
251  return NULL;
252  };
253  //! @endcond
254 
255 
256  /*!
257  @cond PRIVATE
258  @brief ネットワーク層におけるパケットのヘッダ部分の合計サイズを返します。単位はバイトです。
259  例えば IPv4 環境であれば、 IP ヘッダ(20byte) + UDP ヘッダ(8byte) = 28 となります。
260  */
261  virtual uint32_t GetHeaderSize() const = 0;
262  //! @endcond
263 
264  /*!
265  @cond PRIVATE
266  @brief MissingStationHandler 具象インスタンスを構築します。
267  */
268  virtual MissingStationHandler* CreateMissingStationHandler()
269  {
270  return NULL;
271  }
272  //! @endcond
273 
274  /* 自動マッチメイク機能用 */
275  /*!
276  @cond PRIVATE
277  @brief Session 用 CreateSessionJob を生成します。
278  */
279  virtual common::StepSequenceJob* CreateMatchCreateSessionJob() = 0;
280  //! @endcond
281 
282 
283  /*!
284  @cond PRIVATE
285  @brief Session 用 AutoSessionmakeSessionJob を生成します。
286  */
287  virtual common::StepSequenceJob* CreateMatchAutoMatchmakeSessionJob() = 0;
288  //! @endcond
289 
290 
291  /*!
292  @cond PRIVATE
293  @brief Session 用 BrowseSessionmakeSessionJob を生成します。
294  */
295  virtual common::StepSequenceJob* CreateMatchBrowseMatchmakeSessionJob() = 0;
296  //! @endcond
297 
298 
299  /*!
300  @cond PRIVATE
301  @brief Session 用 JoinSessionJob を生成します。
302  */
303  virtual common::StepSequenceJob* CreateMatchJoinSessionJob() = 0;
304  //! @endcond
305 
306 
307  /*!
308  @cond PRIVATE
309  @brief Session 用 LeaveSessionJob を生成します。
310  */
311  virtual common::StepSequenceJob* CreateMatchLeaveSessionJob() = 0;
312  //! @endcond
313 
314 
315  /*!
316  @cond PRIVATE
317  @brief Session 用 DestroySessionJob を生成します。
318  */
319  virtual common::StepSequenceJob* CreateMatchDestroySessionJob() = 0;
320  //! @endcond
321 
322  /*!
323  @cond PRIVATE
324  @brief Session 用 CreateGenerateMatchmakeSystemPasswordJob を生成します。
325  */
326  virtual common::StepSequenceJob* CreateGenerateMatchmakeSystemPasswordJob() = 0;
327  //! @endcond
328 
329  /*!
330  @cond PRIVATE
331  @brief Session 用 CreateClearMatchmakeSystemPasswordJob を生成します。
332  */
333  virtual common::StepSequenceJob* CreateClearMatchmakeSystemPasswordJob() = 0;
334  //! @endcond
335 
336  /*!
337  @cond PRIVATE
338  @brief Session 用 MatchmakeSessionSystemPassword の保持領域を生成します。
339  */
340  virtual common::String* CreateMatchmakeSessionSystemPassword() = 0;
341  //! @endcond
342 
343  /*!
344  @cond PRIVATE
345  @brief ジョイントセッション機能用 JointSessionJob を生成します。
346  */
347  virtual common::StepSequenceJob* CreateJointSessionJob() = 0;
348  //! @endcond
349 
350  /*!
351  @cond PRIVATE
352  @brief Session 用 UpdateSessionSetting を生成します。
353  */
354  virtual common::StepSequenceJob* CreateUpdateSessionSettingJob() = 0;
355  //! @endcond
356 
357  /*!
358  @cond PRIVATE
359  @brief Session 用 CommunityManagementJob を生成します。
360  */
361  virtual common::StepSequenceJob* CreateCommunityManagementJob() = 0;
362  //! @endcond
363 
364  /*!
365  @cond PRIVATE
366  @brief Session 用 ISessionInfoList を生成します。
367  */
368  virtual session::ISessionInfoList* CreateSessionInfoList(uint16_t browseSessionInfoListNum) = 0;
369  //! @endcond
370 
371  /*!
372  @cond PRIVATE
373  @brief Session 用 ISessionInfoList を生成します。
374  */
375  virtual session::ICommunityInfoList* CreateCommunityInfoList(uint8_t browsedCommunityInfoListNum) = 0;
376  //! @endcond
377 
378 
379  /*!
380  @cond PRIVATE
381  @brief Session 用 IMatchmakeSession を生成します。
382  */
383  virtual session::IMatchmakeSession* CreateMatchmakeSession() = 0;
384  //! @endcond
385 
386  /*!
387  @cond PRIVATE
388  @brief Session 用 MeshLayerController を生成します。
389  */
390  virtual session::MeshLayerController* CreateMatchMeshLayerController() = 0;
391  //! @endcond
392 
393  /*!
394  @cond PRIVATE
395  @brief Bind() が必要かどうか。
396  */
397  virtual bool IsBindRequired() const = 0;
398  //! @endcond
399 
400  /*!
401  @cond PRIVATE
402  @brief サーバーが必要かどうか。
403  */
404  virtual bool IsServerRequired() const = 0;
405  //! @endcond
406 
407  /*!
408  @cond PRIVATE
409  @brief いっしょに遊んだプレイヤー履歴を記録可能かどうか。
410  */
411  virtual bool IsRecentPlayRecordPermitted() const = 0;
412  //! @endcond
413 
414  /*!
415  @cond PRIVATE
416  @brief 同じ端末から複数プレイヤーが参加可能かどうか。
417  */
418  virtual bool IsMultiplayerPermitted() const = 0;
419  //! @endcond
420 
421  /*!
422  @cond PRIVATE
423  @brief ホストマイグレーションのモードを取得します。
424  */
425  virtual int32_t GetHostMigrationMode() const = 0;
426  //! @endcond
427 
428  /*!
429  @cond PRIVATE
430  @brief セッションの検索結果の最大数を取得します。
431  */
432  virtual uint16_t GetBrowseSessionInfoListSizeMax() const = 0;
433  //! @endcond
434 
435  /*!
436  @cond PRIVATE
437  @brief コミュニティの検索結果の最大数を取得します。
438  */
439  virtual uint8_t GetBrowseCommunityInfoListSizeMax() const = 0;
440  //! @endcond
441 
442  /*!
443  @cond PRIVATE
444  @brief MTU の最大値(UDP、IPv4 のヘッダのようなネットワーク層のヘッダサイズを含む)です。
445  */
446  virtual uint32_t GetMtuSizeMax() const = 0;
447  //! @endcond
448 
449  /*!
450  @cond PRIVATE
451  @brief MTU の最小値(UDP、IPv4 のヘッダのようなネットワーク層のヘッダサイズを含む)です。
452  */
453  virtual uint32_t GetMtuSizeMin() const = 0;
454  //! @endcond
455 
456  /*!
457  @cond PRIVATE
458  @brief 初期段階での RTT 計測パルス送信間隔のデフォルト値です。単位はミリ秒です。
459  */
460  virtual int GetDefaultRttInitialPulseInterval() const = 0;
461  //! @endcond
462 
463  virtual bool IsConnectionRequestPrincipalIdEnabled() const
464  {
465  return true;
466  }
467 
468  /* 自動マッチメイク機能用 */
469 
470 protected:
471  /*!
472  @cond PRIVATE
473  */
475  {
476  }
477  //! @endcond
478 };
479 }
480 }
481 } // end of namespace nn::pia::transport