📄 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_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -