Skip to content

Commit f32c16d

Browse files
committed
modify:get all for action session
1 parent 208ece1 commit f32c16d

File tree

5 files changed

+66
-0
lines changed

5 files changed

+66
-0
lines changed

XEngine_Source/StorageModule_Session/Session_Action/Session_Action.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,47 @@ bool CSession_Action::Session_Action_GetInfo(XNETHANDLE xhToken, XENGINE_ACTIONI
135135
return true;
136136
}
137137
/********************************************************************
138+
函数名称:Session_Action_GetAll
139+
函数功能:获得所有动作器句柄
140+
参数.一:pppxhToken
141+
In/Out:Out
142+
类型:三级指针
143+
可空:N
144+
意思:输出获取到的句柄列表
145+
参数.二:pInt_ListCount
146+
In/Out:Out
147+
类型:整数型指针
148+
可空:N
149+
意思:输出列表个数
150+
返回值
151+
类型:逻辑型
152+
意思:是否成功
153+
备注:
154+
*********************************************************************/
155+
bool CSession_Action::Session_Action_GetAll(XNETHANDLE*** pppxhToken, int* pInt_ListCount)
156+
{
157+
Session_IsErrorOccur = false;
158+
159+
st_Locker.lock_shared();
160+
*pInt_ListCount = stl_MapAction.size();
161+
BaseLib_OperatorMemory_Malloc((XPPPMEM)pppxhToken, *pInt_ListCount, sizeof(XNETHANDLE));
162+
163+
unordered_map<XNETHANDLE, SESSION_ACTIONINFO>::iterator stl_MapIterator = stl_MapAction.begin();
164+
for (int i = 0; stl_MapIterator != stl_MapAction.end(); stl_MapIterator++, i++)
165+
{
166+
*(*pppxhToken)[i] = stl_MapIterator->first;
167+
}
168+
st_Locker.unlock_shared();
169+
170+
if (*pInt_ListCount <= 0)
171+
{
172+
Session_IsErrorOccur = true;
173+
Session_dwErrorCode = ERROR_STORAGE_MODULE_SESSION_EMPTY;
174+
return false;
175+
}
176+
return true;
177+
}
178+
/********************************************************************
138179
函数名称:Session_Action_Delete
139180
函数功能:删除一个动作管理器
140181
参数.一:xhToken

XEngine_Source/StorageModule_Session/Session_Action/Session_Action.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class CSession_Action
2525
bool Session_Action_Insert(XNETHANDLE xhToken, XHANDLE xhAction, XENGINE_ACTIONINFO* pSt_ActionInfo);
2626
XHANDLE Session_Action_GetToken(XNETHANDLE xhToken);
2727
bool Session_Action_GetInfo(XNETHANDLE xhToken, XENGINE_ACTIONINFO* pSt_ActionInfo);
28+
bool Session_Action_GetAll(XNETHANDLE*** pppxhToken, int* pInt_ListCount);
2829
bool Session_Action_Delete(XNETHANDLE xhToken);
2930
private:
3031
shared_mutex st_Locker;

XEngine_Source/StorageModule_Session/Session_Define.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,25 @@ extern "C" XHANDLE Session_Action_GetToken(XNETHANDLE xhToken);
571571
*********************************************************************/
572572
extern "C" bool Session_Action_GetInfo(XNETHANDLE xhToken, XENGINE_ACTIONINFO* pSt_ActionInfo);
573573
/********************************************************************
574+
函数名称:Session_Action_GetAll
575+
函数功能:获得所有动作器句柄
576+
参数.一:pppxhToken
577+
In/Out:Out
578+
类型:三级指针
579+
可空:N
580+
意思:输出获取到的句柄列表
581+
参数.二:pInt_ListCount
582+
In/Out:Out
583+
类型:整数型指针
584+
可空:N
585+
意思:输出列表个数
586+
返回值
587+
类型:逻辑型
588+
意思:是否成功
589+
备注:
590+
*********************************************************************/
591+
extern "C" bool Session_Action_GetAll(XNETHANDLE*** pppxhToken, int* pInt_ListCount);
592+
/********************************************************************
574593
函数名称:Session_Action_Delete
575594
函数功能:删除一个动作管理器
576595
参数.一:xhToken

XEngine_Source/StorageModule_Session/StorageModule_Session.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ EXPORTS
3434
Session_Action_Insert
3535
Session_Action_GetToken
3636
Session_Action_GetInfo
37+
Session_Action_GetAll
3738
Session_Action_Delete

XEngine_Source/StorageModule_Session/pch.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ extern "C" bool Session_Action_GetInfo(XNETHANDLE xhToken, XENGINE_ACTIONINFO *
153153
{
154154
return m_Action.Session_Action_GetInfo(xhToken, pSt_ActionInfo);
155155
}
156+
extern "C" bool Session_Action_GetAll(XNETHANDLE * **pppxhToken, int* pInt_ListCount)
157+
{
158+
return m_Action.Session_Action_GetAll(pppxhToken, pInt_ListCount);
159+
}
156160
extern "C" bool Session_Action_Delete(XNETHANDLE xhToken)
157161
{
158162
return m_Action.Session_Action_Delete(xhToken);

0 commit comments

Comments
 (0)