OROCHI
 
Loading...
Searching...
No Matches
GxNpTrophyController.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12#if defined(_PS4) || defined(_PS5)
13
14GX_NETWORK_NAMESPACE_BEGIN()
15
16//===========================================================================
17//非同期のトロフィー解除リクエスト送信クラス
18//システムで勝手にスレッド作っても構わない場合の使用を想定しています。
20//===========================================================================
21class GxNpTrophyController : public GxThread
22{
23 //-----------------------------------------------------------
25 //-----------------------------------------------------------
27public:
29 struct Config
30 {
31 //-----------------------------------------------------------
33 //-----------------------------------------------------------
35
37 Config(void) : _maxRequest(2), _priority(GxThread::PRIORITY::BELOW), _cpuIndex(-1), _stackSize(GxMath::VALUE_64K){}
38
40 //-----------------------------------------------------------
42 //-----------------------------------------------------------
44
45 u32 _maxRequest;
46 GxThread::PRIORITY _priority;
47 s32 _cpuIndex;
48 u32 _stackSize;
49
51 };
52
53private:
54 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::SYSTEM)
55
56
57 enum class STATE
58 {
59 NOT_INITIALIZE,
60 NOT_SETUP,
61 REQUEST_SETUP,
62 ACCEPT_REQUEST,
63 STOP,
64 };
65
67 //-----------------------------------------------------------
69 //-----------------------------------------------------------
71public:
73 static GxNpTrophyController* createInstance(void);
74
76 s32 initialize(const Config& config);
78 void terminate(void);
79
80private:
82 GxNpTrophyController(void) : _pTrophy(nullptr), _state(STATE::NOT_INITIALIZE) {}
84 ~GxNpTrophyController(void) {}
85
87 //-----------------------------------------------------------
89 //-----------------------------------------------------------
91public:
93 b32 requestSetup(void);
94
96 b32 isFinishSetup(void);
97
99 b32 requestUnlock(GxNativeTrophyID trophyID);
100
102 b32 isEmpty(void);
103private:
105 void threadMain(void* pArgument) override;
106
108 //-----------------------------------------------------------
110 //-----------------------------------------------------------
112private:
114 GxNpTrophy* _pTrophy;
115 GxEvent _event;
116 GxCriticalSection _criticalSection;
117 STATE _state;
118
120};
121
122GX_NETWORK_NAMESPACE_END()
123
124#endif //_PS4 || _PS5
pThis threadMain(pThis->_pIn)
クリティカルセクションクラス
Definition GxThread.h:20
イベントクラス
Definition GxThread.h:132
キュー (ロック不要)
Definition GxLockFreeQueue.h:19
算術演算クラス
Definition GxMath.h:84
スレッドクラス
Definition GxThread.h:177
PRIORITY
優先度
Definition GxThread.h:199
32bitブーリアン
Definition GxDefine.h:173