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