CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
common_IPacketOutput.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/common/common_Definitions.h>
17 
18 #include <nn/pia/common/private/common_Packet.h>
19 
20 
21 namespace nn
22 {
23 namespace pia
24 {
25 namespace common
26 {
27 
28 
29 /*!
30 @cond PRIVATE
31  @brief Packet を書き込むインタフェースとなるクラスです。
32  */
33 class IPacketOutput
34 {
35 public:
36  /*!
37  @brief デフォルトコンストラクタです。
38  */
39  IPacketOutput(void)
40  {
41  }
42 
43 
44  /*!
45  @brief デストラクタです。
46  */
47  virtual ~IPacketOutput(void)
48  {
49  }
50 
51  virtual Result OnStationConnectionEvent() = 0;
52 
53  /*!
54  @brief 書き込みインタフェースです。
55 
56  @param[in] packetData 書き込むPacket。
57  @return 書き込みに成功すれば、IsSuccess()がtrueを返すResultが返ります。
58  @retval ResultInvalidArgument 引数が誤っています(packetの宛先がおかしいなど)
59  @retval ResultInvalidState このAPIを呼び出すタイミングが誤っています(初期化処理が済んでいないなど)
60  @retval ResultBufferIsFull 内部バッファの一時的な枯渇や処理能力の限界により、送信が失敗したことを示します。
61  @retval ResultNetworkConnectionIsLost ネットワーク接続が失われた状態を示します。
62  */
63  virtual Result Write(const nn::pia::common::Packet& packetData) = 0;
64 
65 
66  /*!
67  @brief マルチキャストで送信できる宛先の最大数を取得します。
68  @details 宛先ビットマップで指定される宛先の数がこの値以下になるようにパケット生成を制御します。
69  @return マルチキャストで送信できる宛先の最大数です。
70  */
71  virtual uint32_t GetMulticastDestinationNum() const
72  {
73  return 1;
74  }
75 
76 
77  /*!
78  @brief ブロードキャストをサポートしているかを取得します。
79  @details これが true であれば、StationIndex_Allで GetMulticastDestinationNum() 以上のビットの立ったパケット生成をすることがあります。
80  @return ブロードキャストをサポートしていれば true を返します。
81  */
82  virtual bool IsBroadcastSupported() const
83  {
84  return false;
85  }
86 };
87 //! @endcond
88 }
89 }
90 } // end of namespace nn::pia::common