usercustoms.h

来自「关于联通的一个统一定制程序」· C头文件 代码 · 共 58 行

H
58
字号
// UserCustoms.h: interface for the CUserCustoms class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_USERCUSTOMS_H__B17602EF_8482_4601_B05E_442816959F1D__INCLUDED_)
#define AFX_USERCUSTOMS_H__B17602EF_8482_4601_B05E_442816959F1D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <vector>
#include <string>
using namespace std;

class CUserCustoms  
{	
	typedef struct tagSubscribeInfo{
		char	pszMobile[20];
		ULONG	lUpdateTime;
		vector<SUBSCRIBEITEM > vItems;
	}SUBSCRIBEINFO;

	class info_filter_by_phone{
		string _phone;
	public:
		info_filter_by_phone(const char* pszPhone):_phone(pszPhone){}
		bool operator()(SUBSCRIBEINFO i){return _phone==i.pszMobile;}
	};

	class info_filter_by_time{
		long _time;
	public:
		info_filter_by_time(const long time):_time(time){}
		bool operator()(SUBSCRIBEINFO i){return _time>i.lUpdateTime;}
	};

	class item_filter_by_index{
		unsigned long _index;
	public:
		item_filter_by_index(unsigned long index):_index(index){}
		bool operator()(SUBSCRIBEITEM i){return i.lIndex==_index;}
	};

	vector<SUBSCRIBEINFO > _infos;
	CCriticalSection _lock;
public:
	int RemoveOneItem(LPCTSTR pszMobile,ULONG lIndex);
	int RemoveOneInfo(LPCTSTR pszMobile);
	int CleanTimeoutInfo();
	int GetMyCustomItemByIndex(LPCTSTR pszMobile,ULONG lIndex,SUBSCRIBEITEM& item);
	int AddOneInfo(LPCTSTR pszMobile,vector<SUBSCRIBEITEM> vval);
	CUserCustoms();
	virtual ~CUserCustoms();

};

#endif // !defined(AFX_USERCUSTOMS_H__B17602EF_8482_4601_B05E_442816959F1D__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?