CTR Pia  4.11.3
Game Communication Engine
transport_NetworkFactory.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: transport_NetworkFactory.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 common
24 {
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 enum HostMigrationMode;
45 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
46 class IMatchmakeReferee;
47 #endif
48 }
49 }
50 } // end of namespace nn::pia::session
51 
52 namespace nn
53 {
54 namespace pia
55 {
56 namespace transport
57 {
58 
59 class ConnectStationJob;
60 class DisconnectStationJob;
61 class PacketHandler;
62 class MissingStationHandler;
63 
64 #if NN_PIA_EXPERIMENT_RELAY
65 class IRelayAddressTable;
66 #endif
67 
68 /*!
69 @brief An interface (factory pattern) for generating the classes needed by the network.
70 @details This class is never instantiated by an application. Use a class that inherits this class.
71 
72 @date 2013-05-16 Added the <tt>IsMultiCandidatePermitted</tt> function.
73 @date 2013-03-28 Added the <tt>CreatePacketHandler</tt> function.
74 @date 2013-03-21 Added the <tt>CreateSignatureSettingStorage</tt> function.
75 @date 2013-03-14 Added the <tt>CreateCreateMeshJob</tt> function.
76 @date 2012-11-27 Added the <tt>IsSignatureRequired</tt> function.
77 @if CTR_DOC
78 @date 2012-04-23 To improve readability, changed the See Also section to refer to <tt>@ref nn::pia::local::UdsNetworkFactory</tt> and <tt>@ref nn::pia::inet::NexNetworkFactory</tt>.
79 @endif
80 @if CAFE_DOC
81 @date 2012-04-23 To improve readability, changed the See Also section to refer to <tt>@ref nn::pia::inet::NexNetworkFactory</tt>.
82 @endif
83 @date 2012-04-06 Initial version.
84 @if CTR_DOC
85 @see nn::pia::local::UdsNetworkFactory
86 @endif
87 @see nn::pia::inet::NexNetworkFactory
88 */
90 {
91 public:
92 /*!
93 @cond PRIVATE
94 @brief Virtual destructor.
95 */
96  virtual ~NetworkFactory(void)
97  {
98  }
99  //! @endcond
100 
101 
102 /*!
103 @cond PRIVATE
104 @brief Instantiates a <tt>ConnectStationJob</tt> object.
105 */
106  virtual ConnectStationJob* CreateConnectStationJob() = 0;
107  //! @endcond
108 
109 
110 /*!
111 @cond PRIVATE
112 @brief Instantiates a <tt>DisconnectStationJob</tt> object.
113 */
114  virtual DisconnectStationJob* CreateDisconnectStationJob() = 0;
115  //! @endcond
116 
117 
118 /*!
119 @cond PRIVATE
120 @brief Instantiates an <tt>InputStream</tt> object.
121 */
122  virtual common::IPacketInput* CreateInputStream() = 0;
123  //! @endcond
124 
125 
126 /*!
127 @cond PRIVATE
128 @brief Instantiates a <tt>CreateMeshJob</tt> object.
129 */
130  virtual common::StepSequenceJob* CreateCreateMeshJob() = 0;
131  //! @endcond
132 
133 
134 /*!
135 @cond PRIVATE
136 @brief Instantiates a <tt>JoinMeshJob</tt> object.
137 */
138  virtual common::StepSequenceJob* CreateJoinMeshJob() = 0;
139  //! @endcond
140 
141 
142 /*!
143 @cond PRIVATE
144 @brief Instantiates a <tt>LeaveMeshJob</tt> object.
145 */
146  virtual common::StepSequenceJob* CreateLeaveMeshJob() = 0;
147  //! @endcond
148 
149 
150 /*!
151 @cond PRIVATE
152 @brief Instantiates an <tt>OutputStream</tt> object.
153 */
154  virtual common::IPacketOutput* CreateOutputStream() = 0;
155  //! @endcond
156 
157 
158 /*!
159 @cond PRIVATE
160 @brief Instantiates a <tt>ProcessHostMigrationJob</tt> object.
161 */
162  virtual common::StepSequenceJob* CreateProcessHostMigrationJob() = 0;
163  //! @endcond
164 
165 
166 /*!
167 @cond PRIVATE
168 @brief Instantiates a <tt>LeaveWithHostMigrationJob</tt> object.
169 */
170  virtual common::StepSequenceJob* CreateLeaveWithHostMigrationJob() = 0;
171  //! @endcond
172 
173 
174 /*!
175 @cond PRIVATE
176 @brief Creates a <tt>KickoutManageJob</tt> object.
177 */
178  virtual common::StepSequenceJob* CreateKickoutManageJob() = 0;
179  //! @endcond
180 
181 
182 /*!
183 @cond PRIVATE
184 @brief Builds the required protocol.
185 */
186  virtual nn::Result CreateProtocols()
187  {
188  return ResultSuccess();
189  }
190  //! @endcond
191 
192 
193 /*!
194 @cond PRIVATE
195 @brief Constructs a concrete instance of the <tt>PacketHandler</tt> class.
196 */
197  virtual PacketHandler* CreatePacketHandler() = 0;
198  //! @endcond
199 
200 
201 /*!
202 @cond PRIVATE
203 @brief Gets whether a signature is required.
204 */
205  virtual bool IsSignatureRequired() const = 0;
206  //! @endcond
207 
208 /*!
209 @cond PRIVATE
210 @brief Creates storage for holding the signature key.
211 */
212  virtual session::SignatureSettingStorage* CreateSignatureSettingStorage() = 0;
213  //! @endcond
214 
215 #if NN_PIA_EXPERIMENT_RELAY
216 /*!
217 @cond PRIVATE
218 @brief Generates an instance of a class that inherits the <tt>IRelayAddressTable</tt> class.
219 */
220  virtual IRelayAddressTable* CreateRelayAddressTable() = 0;
221 //! @endcond
222 #endif
223 
224 
225 #if NN_PIA_ENABLE_FEEDBACK
226 /*!
227 @cond PRIVATE
228 @brief Creates a <tt>FeedbackProtocol</tt> object.
229 @return Returns a handle to a <tt>FeedbackProtocol</tt> object.
230 */
231  virtual u32 CreateFeedbackProtocol()
232  {
233  return 0;
234  }
235 //! @endcond
236 #endif
237 
238 /*!
239 @cond PRIVATE
240 @brief Gets whether multiple-candidate host migration is allowed.
241 */
242  virtual bool IsMultiCandidatePermitted() const
243  {
244  return false;
245  }
246  //! @endcond
247 
248 /*!
249 @cond PRIVATE
250 @brief Gets whether the use of the relay communication feature is allowed.
251 */
252  virtual bool IsRelayConnectionPermitted() const
253  {
254  return false;
255  }
256  //! @endcond
257 
258 /*!
259 @cond PRIVATE
260 @brief Gets whether the use of joint session features is allowed.
261 */
262  virtual bool IsJointSessionPermitted() const
263  {
264  return false;
265  }
266  //! @endcond
267 
268 /*!
269 @cond PRIVATE
270 @brief Creates an instance of a class that inherits the <tt>MonitoringDataSender</tt> class.
271 */
272  virtual common::MonitoringDataSender* CreateMonitoringDataSender()
273  {
274  return NULL;
275  };
276  //! @endcond
277 
278 
279 /*!
280 @cond PRIVATE
281 @brief Gets the total size of the header portion of packets at the network layer. This value is in bytes.
282 In IPv4 environments, for example, that would mean the IP header (20 bytes) plus the UDP header (8 bytes), which would be 28 bytes.
283 */
284  virtual size_t GetHeaderSize() const = 0;
285  //! @endcond
286 
287 /*!
288 @cond PRIVATE
289 @brief Constructs a concrete instance of the <tt>MissingStationHandler</tt> class.
290 */
291  virtual MissingStationHandler* CreateMissingStationHandler()
292  {
293  return NULL;
294  }
295  //! @endcond
296 
297 /* For the auto-matchmaking feature. */
298 /*!
299 @cond PRIVATE
300 @brief Instantiates a <tt>CreateSessionJob</tt> object for the session.
301 */
302  virtual common::StepSequenceJob* CreateMatchCreateSessionJob() = 0;
303  //! @endcond
304 
305 
306 /*!
307 @cond PRIVATE
308 @brief Instantiates an <tt>AutoSessionmakeSessionJob</tt> object for the session.
309 */
310  virtual common::StepSequenceJob* CreateMatchAutoMatchmakeSessionJob() = 0;
311  //! @endcond
312 
313 
314 /*!
315 @cond PRIVATE
316 @brief Instantiates a <tt>BrowseSessionmakeSessionJob</tt> object for the session.
317 */
318  virtual common::StepSequenceJob* CreateMatchBrowseMatchmakeSessionJob() = 0;
319  //! @endcond
320 
321 
322 /*!
323 @cond PRIVATE
324 @brief Instantiates a <tt>JoinSessionJob</tt> object for the session.
325 */
326  virtual common::StepSequenceJob* CreateMatchJoinSessionJob() = 0;
327  //! @endcond
328 
329 
330 /*!
331 @cond PRIVATE
332 @brief Instantiates a <tt>LeaveSessionJob</tt> object for the session.
333 */
334  virtual common::StepSequenceJob* CreateMatchLeaveSessionJob() = 0;
335  //! @endcond
336 
337 
338 /*!
339 @cond PRIVATE
340 @brief Instantiates a <tt>DestroySessionJob</tt> object for the session.
341 */
342  virtual common::StepSequenceJob* CreateMatchDestroySessionJob() = 0;
343  //! @endcond
344 
345 /*!
346 @cond PRIVATE
347 @brief Instantiates a <tt>CreateGenerateMatchmakeSystemPasswordJob</tt> object for the session.
348 */
349  virtual common::StepSequenceJob* CreateGenerateMatchmakeSystemPasswordJob() = 0;
350  //! @endcond
351 
352 /*!
353 @cond PRIVATE
354 @brief Instantiates a <tt>CreateClearMatchmakeSystemPasswordJob</tt> object for the session.
355 */
356  virtual common::StepSequenceJob* CreateClearMatchmakeSystemPasswordJob() = 0;
357  //! @endcond
358 
359 /*!
360 @cond PRIVATE
361 @brief Gets the length of the session's <tt>MatchmakeSessionSystemPassword</tt>.
362 Generates a maintenance region from this value.
363 */
364  virtual u32 GetMatchmakeSessionSystemPasswordSize() const = 0;
365  //! @endcond
366 
367 /*!
368 @cond PRIVATE
369 @brief Generates a maintenance region for the session's <tt>MatchmakeSessionSystemPassword</tt>.
370 */
371  virtual wchar_t* CreateMatchmakeSessionSystemPassword(u32 size) = 0;
372  //! @endcond
373 
374 /*!
375 @cond PRIVATE
376 @brief Instantiates a <tt>JointSessionJob</tt> object for joint sessions.
377 */
378  virtual common::StepSequenceJob* CreateJointSessionJob() = 0;
379  //! @endcond
380 
381 /*!
382 @cond PRIVATE
383 @brief Instantiates a <tt>ModifyAttributeJob</tt> object for the session.
384 */
385  virtual common::StepSequenceJob* CreateModifyAttributeJob() = 0;
386  //! @endcond
387 
388 /*!
389 @cond PRIVATE
390 @brief Instantiates a <tt>UpdateSessionSetting</tt> object for the session.
391 */
392  virtual common::StepSequenceJob* CreateUpdateSessionSettingJob() = 0;
393  //! @endcond
394 
395 /*!
396 @cond PRIVATE
397 @brief Instantiates a <tt>UpdateApplicationBufferJob</tt> object for the session.
398 */
399  virtual common::StepSequenceJob* CreateUpdateApplicationDataJob() = 0;
400  //! @endcond
401 
402 /*!
403 @cond PRIVATE
404 @brief Instantiates an <tt>ISessionInfoList</tt> object for the session.
405 */
406  virtual session::ISessionInfoList* CreateSessionInfoList(u8 browseSessionInfoListNum) = 0;
407  //! @endcond
408 
409 /*!
410 @cond PRIVATE
411 @brief Instantiates an <tt>IMatchmakeSession</tt> object for the session.
412 */
413  virtual session::IMatchmakeSession* CreateMatchmakeSession() = 0;
414  //! @endcond
415 
416 /*!
417 @cond PRIVATE
418 @brief Instantiates a <tt>MeshLayerController</tt> object for the session.
419 */
420  virtual session::MeshLayerController* CreateMatchMeshLayerController() = 0;
421  //! @endcond
422 
423 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
424  virtual session::IMatchmakeReferee* CreateMatchmakeReferee() = 0;
425 
426  virtual common::StepSequenceJob* CreateRefereeStartGameJob() = 0;
427 
428  virtual common::StepSequenceJob* CreateRefereeEndGameJob() = 0;
429 
430  virtual common::StepSequenceJob* CreateRefereeEndGameWithoutReportJob() = 0;
431 
432  virtual common::StepSequenceJob* CreateRefereeGetOrCreateStatsJob() = 0;
433 #endif
434 
435 /*!
436 @cond PRIVATE
437 @brief Gets whether a call to <tt>Bind</tt> is required.
438 */
439  virtual bool GetNecessaryBind() const = 0;
440  //! @endcond
441 
442 /*!
443 @cond PRIVATE
444 @brief Gets whether a server is required.
445 */
446  virtual bool GetNecessaryServer() const = 0;
447  //! @endcond
448 
449 /*!
450 @cond PRIVATE
451 @brief Gets the host migration mode.
452 */
453  virtual session::HostMigrationMode GetHostMigrationMode() const = 0;
454  //! @endcond
455 
456 /*!
457 @cond PRIVATE
458 @brief Gets the maximum number of session search results.
459 */
460  virtual u8 GetBrowseSessionInfoListMax() const = 0;
461  //! @endcond
462 
463 /* For the auto-matchmaking feature. */
464 
465 protected:
466 /*!
467 @cond PRIVATE
468 */
470  {
471  }
472  //! @endcond
473 };
474 }
475 }
476 } // end of namespace nn::pia::transport
Definition: assert.h:115
The interface for the session information list.
Definition: session_ISessionInfoList.h:32
An interface (factory pattern) for generating the classes needed by the network.
Definition: transport_NetworkFactory.h:89
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40