4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
24 #include "ipc-queue.h"
25 #include "ipc-library-build.h"
26 #include "emf-dbglog.h"
28 ipcEmailQueue::ipcEmailQueue()
35 ipcEmailQueue::~ipcEmailQueue()
39 void* ipcEmailQueue::Pop()
42 ipcEmailQueueItem *pPopped = m_pHead;
43 void* pData = pPopped->Get();
45 if(pPopped->m_pNext) {
46 m_pHead = pPopped->m_pNext;
48 m_pHead = m_pTail = NULL;
53 m_nCount = (m_nCount <= 0)? 0 : m_nCount-1;
60 bool ipcEmailQueue::Push(void* a_pData)
62 /* EM_DEBUG_FUNC_BEGIN(); */
64 EM_DEBUG_EXCEPTION("[IPCLib] ipcEmailQueue::Push - invalid input \n");
68 ipcEmailQueueItem *pItem = new ipcEmailQueueItem(a_pData);
70 m_pTail->m_pNext = pItem;
73 m_pHead = m_pTail = pItem;
77 pItem->m_pNext = NULL;
81 int ipcEmailQueue::GetCount()
89 ipcEmailQueueItem::ipcEmailQueueItem()
95 ipcEmailQueueItem::ipcEmailQueueItem(void* a_pData)
101 ipcEmailQueueItem::~ipcEmailQueueItem()
105 void* ipcEmailQueueItem::Get()
110 void ipcEmailQueueItem::Set(void* a_pData)