CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
local_LocalSessionInfo.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/local/local_LocalSessionTypes.h>
17 #include <nn/pia/local/local_LocalNetworkSetting.h>
18 #include <nn/pia/session/session_ISessionInfo.h>
19 
20 
21 namespace nn
22 {
23 namespace pia
24 {
25 namespace local
26 {
27 
28 class LocalNetworkDescription;
29 
30 /*!
31  @brief ローカル通信のセッション情報クラスです。
32 */
34 {
35 public:
36  /*!
37  @brief デストラクタ。
38  */
39  virtual ~LocalSessionInfo();
40 
41  /*!
42  @brief セッションのゲームモードを取得します。
43  @details 通信モード識別用 ID を uint32_t にキャストして返します。
44  @return セッションのゲームモードを返します。
45  */
46  virtual uint32_t GetGameMode() const = 0;
47 
48  /*!
49  @brief セッションの ID を取得します。
50  @details 同じセッション ID を持つ異なるセッションが存在する場合があります。
51  @return セッションの ID を返します。
52  */
53  virtual uint32_t GetSessionId() const = 0;
54 
55  /*!
56  @brief セッションに参加している人数を取得します。
57  @return セッションに参加している人数を返します。
58  */
59  virtual uint16_t GetCurrentParticipantNum() const = 0;
60 
61  /*!
62  @brief セッションに参加できる最小人数を取得します。
63  @return セッションに参加できる最小人数を返します。
64  */
65  virtual uint16_t GetMinParticipantNum() const;
66 
67  /*!
68  @brief セッションに参加できる最大人数を取得します。
69  @return セッションに参加できる最大人数を返します。
70  */
71  virtual uint16_t GetMaxParticipantNum() const = 0;
72 
73  /*!
74  @brief セッションが参加募集受付状態かどうかを取得します。
75  @return セッションが参加募集受付状態なら true, 参加募集締切状態なら false を返します。
76  */
77  virtual bool IsOpened() const = 0;
78 
79  /*!
80  @brief セッションのアプリケーション定義データを取得します。
81  @details セッションに設定したアプリケーション定義データを取得します。
82  @param[out] pBuffer セッションのアプリケーション定義データのコピー用バッファのポインタ。
83  @param[in] size セッションのアプリケーション定義データのコピー用バッファのサイズ。
84  @return 正常に情報を取得できた場合、成功の Result が返ります。
85  */
86  virtual Result GetApplicationData(void* pBuffer, uint32_t size) const = 0;
87 
88  /*!
89  @brief セッションのアプリケーション定義データの長さを取得します。
90  @return セッションのアプリケーション定義データの長さが返ります。
91  */
92  virtual uint32_t GetApplicationDataSize() const = 0;
93 
94  /*!
95  @brief セッションの電波強度を取得します。
96  @return セッションの電波強度が返ります。
97  */
98  virtual uint8_t GetRadioStrength() const;
99 
100  /*!
101  @brief セッションに参加中のステーション情報を取得します。
102  @param[out] pSessionStationInfoList ステーション情報リスト格納先のポインタ。
103  @param[in] sessionStationInfoListSize ステーション情報リスト格納先のサイズ。
104  @return 正常に情報を取得できた場合、成功の Result が返ります。
105  */
106  virtual Result GetSessionStationInfo(LocalStationInfo* pSessionStationInfoList, uint32_t sessionStationInfoListSize) const = 0;
107 
108  /*!
109  @brief BSSID(ホストの MAC アドレス)を取得します。
110  @details BSSID のサイズは @ref BssIdSize バイトです。
111  @param[out] pBssid BSSID の格納先バッファのポインタ。
112  @param[in] size BSSID の格納先バッファのサイズ。
113  @return 正常に情報を取得できた場合、成功の Result が返ります。
114  */
115  virtual Result GetBssid(uint8_t* pBssid, uint32_t size) const = 0;
116 
117  /*!
118  @brief セッションにユーザーパスワードが設定されているかどうかを確認します。
119  @return ユーザーパスワードが設定されている場合は true が返ります。
120  */
121  virtual bool IsRestrictedByUserPassword() const;
122 
123  /*!
124  @brief セッション情報をクリアします。
125  */
126  virtual void Clear();
127 
128  /*!
129  @brief デバッグに有用な情報をプリントします。
130  @param[in] flag トレースフラグの論理和。詳細は @ref TraceFlag 型を参照してください。
131  */
132  virtual void Trace(uint64_t flag) const;
133 
134  //! @cond PRIVATE
135  virtual void SetLocalNetworkDescription(uint32_t networkIndex, const LocalNetworkDescription* pDescription) = 0;
136  virtual const LocalNetworkDescription* GetLocalNetworkDescription() const = 0;
137  void SetRadioStrength(uint32_t index); // index はネットワーク検索時のインデックス
138  void SetLinkLevel(uint8_t linkLevel); // セッション参加中に電波強度を直接設定
139  virtual Result SetSessionStationInfo(uint32_t index) = 0; // index はネットワーク検索時のインデックス
140  virtual void SetRestrictedByUserPassword(bool b);
141  //! @endcond
142 
143 protected:
144  void Copy(const LocalSessionInfo& rhs);
145 
146 protected:
147  bool m_IsNetworkDescriptionSet;
148 
149  uint8_t m_RadioStrength;
150 
151  bool m_IsRestrictedByUserPassword;
152 
154 
155 private:
156  NN_PIA_DISALLOW_COPY(LocalSessionInfo);
157 };
158 }
159 }
160 } // end of namespace nn::pia::local2