|
Nokia N97 SDK Example Applications Guide |
00001 /** 00002 * @file Stack.cpp 00003 * Part of : Open C / ProducerConsumer 00004 * 00005 * Description : ProducerConsumer Problem solution 00006 * Version : 0.1 00007 * 00008 * Copyright (c) 2007 Nokia Corporation. 00009 * This material, including documentation and any related 00010 * computer programs, is protected by copyright controlled by 00011 * Nokia Corporation. 00012 */ 00013 00014 // INCLUDE FILES 00015 #include "Stack.h" 00016 00017 //Global Stack Object for maintaining all the produced items 00018 Stack stack; 00019 00020 /***************************************************************************** 00021 * CreateObserverThread 00022 * Function: Functions to Push Items on to Stack and Pop items from Stack 00023 * And also to delete Items 00024 *******************************************************************************/ 00025 00026 extern "C" 00027 { 00028 00029 void PushOntoStack( ProducedItem* aItem ) 00030 { 00031 stack.Push(aItem); 00032 } 00033 00034 ProducedItem* PopFromStack() 00035 { 00036 return stack.Pop(); 00037 } 00038 00039 void FreeItem(ProducedItem* aItem) 00040 { 00041 delete aItem; 00042 } 00043 00044 } //extern "C" 00045 00046 // End of File
|
© Nokia 2009 |