#include <msgqueue.h>
Public Member Functions | |
CMsgManager () | |
~CMsgManager () | |
int | Initialize (const unsigned int nMsg) |
void | Free (StrMsg *Msg) |
StrMsg * | New () |
Private Attributes | |
CRioFreeList | m_FreeList |
StrMsg * | m_Msg |
Definition at line 51 of file msgqueue.h.
CMsgManager::CMsgManager | ( | ) |
Definition at line 54 of file msgqueue.cpp.
00055 { 00056 m_Msg = 0; 00057 }
CMsgManager::~CMsgManager | ( | ) |
Definition at line 59 of file msgqueue.cpp.
void CMsgManager::Free | ( | StrMsg * | Msg | ) |
Definition at line 92 of file msgqueue.cpp.
00093 { 00094 m_FreeList.Free( (RioQueueEle*)Msg); 00095 }
int CMsgManager::Initialize | ( | const unsigned int | nMsg | ) |
Definition at line 68 of file msgqueue.cpp.
00069 { 00070 // In case was initialized before 00071 if(m_Msg != 0) 00072 { 00073 delete[] m_Msg; 00074 } 00075 00076 m_Msg = new StrMsg[nMsg]; 00077 00078 if(m_Msg == 0) 00079 return ERROR_SS_MEMORY; 00080 00081 for(int i= ((int)(nMsg))-1; i>=0; i--) 00082 { 00083 m_FreeList.Free((RioQueueEle*)&m_Msg[i]); 00084 } 00085 00086 return (0); 00087 00088 }
StrMsg * CMsgManager::New | ( | ) |
Definition at line 100 of file msgqueue.cpp.
00101 { 00102 return (StrMsg*) m_FreeList.Get(); 00103 }
CRioFreeList CMsgManager::m_FreeList [private] |
Definition at line 60 of file msgqueue.h.
StrMsg* CMsgManager::m_Msg [private] |
Definition at line 61 of file msgqueue.h.