CTR Pia  4.11.3
Game Communication Engine
local_LocalNetworkFactory.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: local_LocalNetworkFactory.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/local/local_definitions.h>
18 #include <pia/transport/transport_NetworkFactory.h>
19 
20 
21 namespace nn
22 {
23 namespace pia
24 {
25 namespace local
26 {
27 
28 
29 /*!
30  @class nn::pia::local::LocalNetworkFactory
31  @brief Base class for creating the classes required for a network that uses the <tt>LocalNetwork</tt> class. It implements the factory pattern.
32 
33  @details This class is never used by an application. Use a class that inherits this class.
34 
35  @see nn::pia::local::UdsNetworkFactory
36 
37  @date 2014-08-01 Added the <tt>CreateMatchOpenRecruitmentJob()</tt> and <tt>CreateMatchCloseRecruitmentJob()</tt> functions.
38  @date 2014-03-03 Initial version.
39 */
41 {
42 public:
43 /*!
44  @cond PRIVATE
45 */
46 
47 
48 /*!
49  @brief The destructor.
50 */
51  virtual ~LocalNetworkFactory(void);
52 
53 /*!
54  @brief Instantiates an <tt>InputStream</tt> object.
55 */
56  virtual nn::pia::common::IPacketInput* CreateInputStream();
57 
58 /*!
59  @brief Instantiates an <tt>OutputStream</tt> object.
60 */
61  virtual nn::pia::common::IPacketOutput* CreateOutputStream();
62 
63 
64 /*!
65  @brief Instantiates a <tt>ConnectStationJob</tt> object.
66 */
67  virtual nn::pia::transport::ConnectStationJob* CreateConnectStationJob();
68 
69 
70 /*!
71  @brief Instantiates a <tt>DisconnectStationJob</tt> object.
72 */
73  virtual nn::pia::transport::DisconnectStationJob* CreateDisconnectStationJob();
74 
75 
76 /*!
77  @brief Instantiates a <tt>CreateMeshJob</tt> object.
78 */
79  virtual nn::pia::common::StepSequenceJob* CreateCreateMeshJob();
80 
81 
82 /*!
83  @brief Instantiates a <tt>JoinMeshJob</tt> object.
84 */
85  virtual nn::pia::common::StepSequenceJob* CreateJoinMeshJob();
86 
87 
88 /*!
89  @brief Instantiates a <tt>LeaveMeshJob</tt> object.
90 */
91  virtual nn::pia::common::StepSequenceJob* CreateLeaveMeshJob();
92 
93 
94 /*!
95  @brief Instantiates a <tt>ProcessHostMigrationJob</tt> object.
96 */
97  virtual nn::pia::common::StepSequenceJob* CreateProcessHostMigrationJob();
98 
99 
100 /*!
101  @brief Instantiates a <tt>LeaveWithHostMigrationJob</tt> object.
102 */
103  virtual common::StepSequenceJob* CreateLeaveWithHostMigrationJob();
104 
105 
106 /*!
107  @brief Creates a <tt>KickoutManageJob</tt> object.
108 */
109  virtual nn::pia::common::StepSequenceJob* CreateKickoutManageJob();
110 
111 
112 /*!
113  @brief Constructs a concrete instance of the <tt>PacketHandler</tt> class.
114 */
115  virtual transport::PacketHandler* CreatePacketHandler();
116 
117 
118 /*!
119  @brief Gets whether a signature is required.
120 */
121  virtual bool IsSignatureRequired() const;
122 
123 
124 /*!
125  @brief Instantiates a <tt>SignatureSettingStorage</tt> object.
126 */
127  virtual session::SignatureSettingStorage* CreateSignatureSettingStorage();
128 
129 
130 /*!
131  @brief Gets the total size of the header portion of packets at the network layer. The value is in bytes.
132 */
133  virtual size_t GetHeaderSize() const
134  {
135  return 10;
136  }
137 
138 
139 /*!
140  @brief Prints information that is useful for debugging.
141 
142  @param[in] flag Specifies the bitwise OR of trace flags. For more information, see the <tt>@ref TraceFlag</tt> API reference.
143 */
144  virtual void Trace(u64 flag) const;
145 
146 /* For the auto-matchmaking feature. */
147 /*!
148  @brief Instantiates a <tt>CreateSessionJob</tt> object for the session.
149 */
150  virtual common::StepSequenceJob* CreateMatchCreateSessionJob();
151 
152 
153 /*!
154  @brief Instantiates an <tt>AutoMatchmakeSessionJob</tt> object for the session.
155 */
156  virtual common::StepSequenceJob* CreateMatchAutoMatchmakeSessionJob();
157 
158 
159 /*!
160  @brief Instantiates a <tt>BrowseMatchmakeSessionJob</tt> object for the session.
161 */
162  virtual common::StepSequenceJob* CreateMatchBrowseMatchmakeSessionJob();
163 
164 
165 /*!
166  @brief Instantiates a <tt>JoinSessionJob</tt> object for the session.
167 */
168  virtual common::StepSequenceJob* CreateMatchJoinSessionJob();
169 
170 
171 /*!
172  @brief Instantiates a <tt>LeaveSessionJob</tt> object for the session.
173 */
174  virtual common::StepSequenceJob* CreateMatchLeaveSessionJob();
175 
176 
177 /*!
178  @brief Instantiates a <tt>DestroySessionJob</tt> object for the session.
179 */
180  virtual common::StepSequenceJob* CreateMatchDestroySessionJob();
181 
182 /*!
183  @brief Instantiates a <tt>JointSessionJob</tt> object for joint sessions.
184 */
185  virtual common::StepSequenceJob* CreateJointSessionJob();
186 
187 /*!
188  @brief Instantiates a <tt>ModifyAttributeJob</tt> object for the session.
189 */
190  virtual common::StepSequenceJob* CreateModifyAttributeJob();
191 
192 /*!
193  @brief Instantiates an <tt>UpdateSessionSetting</tt> object for the session.
194 */
195  virtual common::StepSequenceJob* CreateUpdateSessionSettingJob();
196 
197 /*!
198  @cond PRIVATE
199  @brief Instantiates an <tt>UpdateApplicationBufferJob</tt> object for the session.
200 */
201  virtual common::StepSequenceJob* CreateUpdateApplicationDataJob();
202  //! @endcond
203 
204 /*!
205  @brief Instantiates a <tt>GenerateMatchmakeSystemPasswordJob</tt> object for the session.
206  This object is not needed locally, so <tt>NULL</tt> is returned.
207 */
208  virtual common::StepSequenceJob* CreateGenerateMatchmakeSystemPasswordJob();
209 
210 /*!
211  @brief Instantiates a <tt>ClearMatchmakeSystemPasswordJob</tt> object for the session.
212  This object is not needed locally, so <tt>NULL</tt> is returned.
213 */
214  virtual common::StepSequenceJob* CreateClearMatchmakeSystemPasswordJob();
215 
216  virtual u32 GetMatchmakeSessionSystemPasswordSize() const;
217 
218  virtual wchar_t* CreateMatchmakeSessionSystemPassword(u32 size);
219 
220 /*!
221  @brief Instantiates an <tt>IMatchmakeSession</tt> object for the session.
222 */
223  virtual session::IMatchmakeSession* CreateMatchmakeSession() = 0;
224 
225 /*!
226  @brief Instantiates an <tt>ISessionInfoList</tt> object for the session.
227 */
228  virtual session::ISessionInfoList* CreateSessionInfoList(u8 browseSessionInfoListNum) = 0;
229 
230 /*!
231  @brief Instantiates a <tt>MeshLayerController</tt> object for the session.
232 */
233  virtual session::MeshLayerController* CreateMatchMeshLayerController();
234 
235 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
236  virtual session::IMatchmakeReferee* CreateMatchmakeReferee();
237 /*!
238  @brief Instantiates a <tt>RefereeStartGameJob</tt> object for the session.
239 */
240  virtual common::StepSequenceJob* CreateRefereeStartGameJob();
241 
242 /*!
243  @brief Instantiates a <tt>RefereeEndGame</tt> object for the session.
244 */
245  virtual common::StepSequenceJob* CreateRefereeEndGameJob();
246 
247 /*!
248  @brief Instantiates a <tt>RefereeEndGameWithoutReportJob</tt> object for the session.
249 */
250  virtual common::StepSequenceJob* CreateRefereeEndGameWithoutReportJob();
251 
252 /*!
253  @brief Instantiates a <tt>RefereeGetOrCreateStatsJob</tt> object for the session.
254 */
255  virtual common::StepSequenceJob* CreateRefereeGetOrCreateStatsJob();
256 #endif
257 
258  virtual bool GetNecessaryBind() const;
259 
260  virtual bool GetNecessaryServer() const;
261 
262  virtual session::HostMigrationMode GetHostMigrationMode() const;
263 
264  virtual u8 GetBrowseSessionInfoListMax() const = 0;
265 
266 
267 /* For the auto-matchmaking feature. */
268 
269 
270 /*!
271  @endcond
272 */
273 
274 protected:
275 /*!
276  @cond PRIVATE
277  @brief Instantiates an object with default parameters (default constructor).
278 */
279  LocalNetworkFactory(void);
280  //! @endcond
281 
282 private:
283 };
284 }
285 }
286 } // End of namespace nn::pia::local.
Base class for creating the classes required for a network that uses the LocalNetwork class...
Definition: local_LocalNetworkFactory.h:40
virtual common::StepSequenceJob * CreateGenerateMatchmakeSystemPasswordJob()
Instantiates a GenerateMatchmakeSystemPasswordJob object for the session. This object is not needed l...
Definition: assert.h:115
virtual session::MeshLayerController * CreateMatchMeshLayerController()
Instantiates a MeshLayerController object for the session.
virtual session::ISessionInfoList * CreateSessionInfoList(u8 browseSessionInfoListNum)=0
Instantiates an ISessionInfoList object for the session.
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
virtual session::IMatchmakeSession * CreateMatchmakeSession()=0
Instantiates an IMatchmakeSession object for the session.
virtual common::StepSequenceJob * CreateClearMatchmakeSystemPasswordJob()
Instantiates a ClearMatchmakeSystemPasswordJob object for the session. This object is not needed loca...