CTR Pia  4.11.3
Game Communication Engine
inet_NexNetworkFactory.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: inet_NexNetworkFactory.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/inet/inet_definitions.h>
18 #include <pia/transport/transport_NetworkFactory.h>
19 
20 namespace nn
21 {
22 namespace pia
23 {
24 namespace inet
25 {
26 
27 /*!
28 @brief This class creates the necessary classes for networks using the NEX library (Internet communication) (factory pattern).
29 
30 @details By setting the <tt>NexNetworkFactory</tt> class for <tt>@ref nn::pia::transport::Transport</tt> or <tt>@ref nn::pia::session::Session</tt>, the library can tailor its network-related processing for the NEX library (such as sending, receiving, and session management).
31 
32 @see nn::pia::transport::Transport::Setting, nn::pia::session::Mesh::Setting, nn::pia::session::Session::Setting
33 
34 @date 2014-08-01 Added the <tt>CreateMatchOpenRecruitmentJob</tt> and <tt>CreateMatchCloseRecruitmentJob</tt> functions.
35 @date 2014-04-03 Added the <tt>CreateMissingStationHandler</tt> function and the <tt>Session</tt> functions
36 @date 2013-05-16 Added the <tt>IsMultiCandidatePermitted</tt> function.
37 @date 2013-03-28 Added the <tt>CreatePacketHandler</tt> function.
38 @date 2013-03-21 Added the <tt>CreateSignatureSettingStorage</tt> function.
39 @date 2013-03-14 Added the <tt>CreateCreateMeshJob</tt> function.
40 @date 2012-11-27 Added the <tt>IsSignatureRequired</tt> function.
41 @date 2012-04-06 Initial version.
42 
43 
44 */
46 {
47 public:
48 
49 /*!
50 @name Finish Initialization
51  @{
52 */
53 
54 /*!
55 @brief Instantiates an object.
56 */
58 
59 /*!
60 @brief Destroys the object.
61 */
62  virtual ~NexNetworkFactory() {}
63 
64 /*!
65 end of name Finish Initialization
66  @}
67 */
68 
69 /*!
70 @cond PRIVATE
71 */
72 
73 /*!
74 @brief Instantiates an <tt>InputStream</tt> object.
75 */
76  virtual nn::pia::common::IPacketInput* CreateInputStream();
77 
78 /*!
79 @brief Instantiates an <tt>OutputStream</tt> object.
80 */
81  virtual nn::pia::common::IPacketOutput* CreateOutputStream();
82 
83 /*!
84 @brief Instantiates a <tt>ConnectStationJob</tt> object.
85 */
86  virtual nn::pia::transport::ConnectStationJob* CreateConnectStationJob();
87 
88 /*!
89 @brief Instantiates a <tt>DisconnectStationJob</tt> object.
90 */
91  virtual nn::pia::transport::DisconnectStationJob* CreateDisconnectStationJob();
92 
93 /*!
94 @brief Instantiates a <tt>CreateMeshJob</tt> object.
95 */
96  virtual nn::pia::common::StepSequenceJob* CreateCreateMeshJob();
97 
98 /*!
99 @brief Instantiates a <tt>JoinMeshJob</tt> object.
100 */
101  virtual nn::pia::common::StepSequenceJob* CreateJoinMeshJob();
102 
103 /*!
104 @brief Instantiates a <tt>LeaveMeshJob</tt> object.
105 */
106  virtual nn::pia::common::StepSequenceJob* CreateLeaveMeshJob();
107 
108 /*!
109 @brief Instantiates a <tt>GenerateMatchmakeSystemPasswordJob</tt> object.
110 */
111  virtual nn::pia::common::StepSequenceJob* CreateGenerateMatchmakeSystemPasswordJob();
112 
113 /*!
114 @brief Instantiates a <tt>ClearMatchmakeSystemPasswordJob</tt> object.
115 */
116  virtual nn::pia::common::StepSequenceJob* CreateClearMatchmakeSystemPasswordJob();
117 
118 /*!
119 @brief Gets the length of the session's <tt>MatchmakeSessionSystemPassword</tt>.
120 Generates a maintenance region from this value.
121 */
122  virtual u32 GetMatchmakeSessionSystemPasswordSize() const;
123 
124 /*!
125 @brief Generates a maintenance region for the session's <tt>MatchmakeSessionSystemPassword</tt>.
126 */
127  virtual wchar_t* CreateMatchmakeSessionSystemPassword(u32 size);
128 
129 /*!
130 @brief Builds the required protocol.
131 */
132  virtual nn::Result CreateProtocols();
133 
134 /*!
135 @brief Instantiates a <tt>ProcessHostMigrationJob</tt> object.
136 */
137  virtual nn::pia::common::StepSequenceJob* CreateProcessHostMigrationJob();
138 
139 /*!
140 @brief Instantiates a <tt>LeaveWithHostMigrationJob</tt> object.
141 */
142  virtual nn::pia::common::StepSequenceJob* CreateLeaveWithHostMigrationJob();
143 
144 /*!
145 @brief Creates a <tt>KickoutManageJob</tt> object.
146 */
147  virtual nn::pia::common::StepSequenceJob* CreateKickoutManageJob();
148 
149 /*!
150 @brief Constructs a concrete instance of the <tt>PacketHandler</tt> class.
151 */
152  virtual transport::PacketHandler* CreatePacketHandler();
153 
154 /*!
155 @brief Gets whether a signature is required.
156 */
157  virtual bool IsSignatureRequired() const;
158 
159 /*!
160 @brief Creates a <tt>Storage</tt> object for setting the signature.
161 */
162  virtual nn::pia::session::SignatureSettingStorage* CreateSignatureSettingStorage();
163 
164 /*!
165 @brief Gets whether multiple-candidate host migration is allowed.
166 */
167  virtual bool IsMultiCandidatePermitted() const;
168 
169 /*!
170 @brief Gets whether the use of the relay communication feature is allowed.
171 */
172  virtual bool IsRelayConnectionPermitted() const;
173 
174 /*!
175 @brief Gets whether the use of joint session features is allowed.
176 */
177  virtual bool IsJointSessionPermitted() const;
178 
179 /*!
180 @brief Creates an instance of a class that inherits the <tt>MonitoringDataSender</tt> class.
181 */
182  virtual common::MonitoringDataSender* CreateMonitoringDataSender();
183 
184 
185 /*!
186 @brief Gets the total size of the header portion of packets at the network layer. The value is in bytes.
187 */
188  virtual size_t GetHeaderSize() const
189  {
190  return 20 + 8;
191  } // IP header (20 bytes) + UDP header (8 bytes)
192 
193 /*!
194 @brief Constructs a concrete instance of the <tt>MissingStationHandler</tt> class.
195 */
196  virtual transport::MissingStationHandler* CreateMissingStationHandler();
197 
198 /*!
199 @brief Instantiates a <tt>CreateSessionJob</tt> object for the session.
200 */
201  virtual common::StepSequenceJob* CreateMatchCreateSessionJob();
202 
203 
204 /*!
205 @brief Instantiates an <tt>AutoMatchmakeSessionJob</tt> object for the session.
206 */
207  virtual common::StepSequenceJob* CreateMatchAutoMatchmakeSessionJob();
208 
209 
210 /*!
211 @brief Instantiates a <tt>BrowseMatchmakeSessionJob</tt> object for the session.
212 */
213  virtual common::StepSequenceJob* CreateMatchBrowseMatchmakeSessionJob();
214 
215 
216 /*!
217 @brief Instantiates a <tt>JoinSessionJob</tt> object for the session.
218 */
219  virtual common::StepSequenceJob* CreateMatchJoinSessionJob();
220 
221 
222 /*!
223 @brief Instantiates a <tt>LeaveSessionJob</tt> object for the session.
224 */
225  virtual common::StepSequenceJob* CreateMatchLeaveSessionJob();
226 
227 
228 /*!
229 @brief Instantiates a <tt>DestroySessionJob</tt> object for the session.
230 */
231  virtual common::StepSequenceJob* CreateMatchDestroySessionJob();
232 
233 /*!
234 @brief Instantiates a <tt>JointSessionJob</tt> object for joint sessions.
235 */
236  virtual common::StepSequenceJob* CreateJointSessionJob();
237 
238 /*!
239 @brief Instantiates a <tt>ModifyAttributeJob</tt> object for the session.
240 */
241  virtual common::StepSequenceJob* CreateModifyAttributeJob();
242 
243 /*!
244 @brief Instantiates a <tt>UpdateSessionSetting</tt> object for the session.
245 */
246  virtual common::StepSequenceJob* CreateUpdateSessionSettingJob();
247 
248 /*!
249 @cond PRIVATE
250 @brief Instantiates a <tt>UpdateApplicationBufferJob</tt> object for the session.
251 */
252  virtual common::StepSequenceJob* CreateUpdateApplicationDataJob();
253  //! @endcond
254 
255 /*!
256 @brief Instantiates an <tt>IMatchmakeSession</tt> object for the session.
257 */
258  virtual session::IMatchmakeSession* CreateMatchmakeSession();
259 
260 /*!
261 @brief Instantiates an <tt>ISessionInfoList</tt> object for the session.
262 */
263  virtual session::ISessionInfoList* CreateSessionInfoList(u8 browseSessionInfoListNum);
264 
265 /*!
266 @brief Instantiates a <tt>MeshLayerController</tt> object for the session.
267 */
268  virtual session::MeshLayerController* CreateMatchMeshLayerController();
269 
270 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
271  virtual session::IMatchmakeReferee* CreateMatchmakeReferee();
272 
273 /*!
274 @brief Instantiates a <tt>RefereeStartGameJob</tt> object for the session.
275 */
276  virtual common::StepSequenceJob* CreateRefereeStartGameJob();
277 
278 /*!
279 @brief Instantiates a <tt>RefereeEndGame</tt> object for the session.
280 */
281  virtual common::StepSequenceJob* CreateRefereeEndGameJob();
282 
283 /*!
284 @brief Instantiates a <tt>RefereeEndGameWithoutReportJob</tt> object for the session.
285 */
286  virtual common::StepSequenceJob* CreateRefereeEndGameWithoutReportJob();
287 
288 /*!
289 @brief Instantiates a <tt>RefereeGetOrCreateStatsJob</tt> object for the session.
290 */
291  virtual common::StepSequenceJob* CreateRefereeGetOrCreateStatsJob();
292 #endif
293 
294 /*!
295 @brief Gets whether a call to <tt>Bind</tt> is required.
296 */
297  virtual bool GetNecessaryBind() const;
298 
299 /*!
300 @brief Gets whether a server is required.
301 */
302  virtual bool GetNecessaryServer() const;
303 
304 /*!
305 @brief Gets the host migration mode.
306 */
307  virtual session::HostMigrationMode GetHostMigrationMode() const;
308 
309 /*!
310 @brief Gets the maximum number of session search results.
311 */
312  virtual u8 GetBrowseSessionInfoListMax() const;
313 
314 /*!
315 @endcond
316 */
317 
318 protected:
319 private:
320 };
321 }
322 }
323 } // end of namespace nn::pia::inet
Definition: assert.h:115
NexNetworkFactory()
Instantiates an object.
Definition: inet_NexNetworkFactory.h:57
virtual bool GetNecessaryServer() const
Gets whether a server is required.
virtual ~NexNetworkFactory()
Destroys the object.
Definition: inet_NexNetworkFactory.h:62
virtual session::ISessionInfoList * CreateSessionInfoList(u8 browseSessionInfoListNum)
Instantiates an ISessionInfoList object for the session.
virtual session::HostMigrationMode GetHostMigrationMode() const
Gets the host migration mode.
The interface for the session information list.
Definition: session_ISessionInfoList.h:32
virtual u8 GetBrowseSessionInfoListMax() const
Gets the maximum number of session search results.
An interface (factory pattern) for generating the classes needed by the network.
Definition: transport_NetworkFactory.h:89
virtual session::IMatchmakeSession * CreateMatchmakeSession()
Instantiates an IMatchmakeSession object for the session.
virtual bool GetNecessaryBind() const
Gets whether a call to Bind is required.
virtual session::MeshLayerController * CreateMatchMeshLayerController()
Instantiates a MeshLayerController object for the session.
This class creates the necessary classes for networks using the NEX library (Internet communication) ...
Definition: inet_NexNetworkFactory.h:45