-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame_commandqueue.cpp
executable file
·86 lines (66 loc) · 1.27 KB
/
frame_commandqueue.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* frame_commandqueue.cpp
*
* Created on: 2012-11-6
* Author: jimm
*/
#include "frame_errordef.h"
#include "frame_commandqueue.h"
FRAME_NAMESPACE_BEGIN
CFrameCommandQueue::CFrameCommandQueue()
{
}
CFrameCommandQueue::~CFrameCommandQueue()
{
}
size_t CFrameCommandQueue::GetSize()
{
return m_stCommandQueue.size();
}
const char* CFrameCommandQueue::GetName()
{
return COMMANDQUEUE_DATACENTER;
}
//初始化CS队列
int32_t CFrameCommandQueue::Initialize()
{
return S_OK;
}
//恢复CS队列
int32_t CFrameCommandQueue::Resume()
{
return S_OK;
}
//注销CS队列
int32_t CFrameCommandQueue::Uninitialize()
{
return S_OK;
}
//从接收队列尾部追加一条消息
int32_t CFrameCommandQueue::Push(NetPacket *pNetPacket)
{
m_stCommandQueue.push_back(pNetPacket);
return S_OK;
}
//从接收队列头部读取一条消息
int32_t CFrameCommandQueue::Pop(NetPacket *&pNetPacket)
{
pNetPacket = NULL;
if(m_stCommandQueue.size() > 0)
{
pNetPacket = m_stCommandQueue.front();
m_stCommandQueue.pop_front();
}
return S_OK;
}
//判断接收队列是否已满
bool CFrameCommandQueue::IsFull()
{
return false;
}
//判读接收队列是否为空
bool CFrameCommandQueue::IsEmpty()
{
return m_stCommandQueue.empty();
}
FRAME_NAMESPACE_END