?? wmsgsenthistory.h
字號:
// WMsgSentHistory.h: interface for the CWMsgSentHistory class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_WMSGSENTHISTORY_H__4F5EDDEE_9238_4B20_876A_2B28428B8259__INCLUDED_)
#define AFX_WMSGSENTHISTORY_H__4F5EDDEE_9238_4B20_876A_2B28428B8259__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "WMsgSent.h"
#include <Afxmt.h>
#include <afxtempl.h>
#include "ArrayTempl.h"
class CWMsgLastFrameNo
{
public :
CWMsgLastFrameNo(LPCSTR lpcszPhoneNumber="");
int operator - (const CWMsgLastFrameNo& toMinus) const;
int Compare( const CWMsgLastFrameNo& toCmp) const;
BYTE GenerateNextFrameNo();
BYTE GetFrameNo() const;
private:
char m_szPhoneNumber[MAX_PHONE_NUMBER_LEN+1]; // to where
BYTE m_lastFrameNo;
};
class CWMsgSentHistory : CList<CWMsgSent, const CWMsgSent&>
{
public:
CWMsgSentHistory();
~CWMsgSentHistory();
// save msg and get frame no , send time etc.
// return FALSE if can not generate an free frame no
BOOL SaveMsg(CWMsgSent& msg);
// has ?
// toFindAndGet, [ in ] phone number and frame no, [out] other content
// bResetSaveTime
BOOL GetACopy(CWMsgSent& toFindAndGet, BOOL bResetSaveTime);
void SetTimeOut(const MsgTimeOutType& timeOut);
void ResetSaveTime();
private:
static MsgSaveTimeType GetSaveTime();
// remove time out one
void RemoveTimeOutItem();
BOOL HasDuplicateItem(const CWMsgSent& toCheck);
POSITION FindDuplicateItem(const CWMsgSent& toCheck);
BYTE GenerateNextFrameNo(LPCSTR lpcszPhoneNumber);
// check if the message is timeout(true)
BOOL CheckTimeOut(const MsgSaveTimeType& currTime, const CWMsgSent& toCheck) const;
BOOL IsLocked() const;
void Lock();
void Unlock();
CCriticalSection m_criticalSection;
BOOL m_bLocked;
MsgTimeOutType m_timeOut;
CMyArray<CWMsgLastFrameNo, const CWMsgLastFrameNo&> m_frameNoHistory;
};
#endif // !defined(AFX_WMSGSENTHISTORY_H__4F5EDDEE_9238_4B20_876A_2B28428B8259__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -