00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_PONGCACHE_H__0F9B689A_5132_49EB_8F13_670563C80A1D__INCLUDED_)
00023 #define AFX_PONGCACHE_H__0F9B689A_5132_49EB_8F13_670563C80A1D__INCLUDED_
00024
00025 #pragma once
00026
00027 class CPongItem;
00028 class CNeighbour;
00029 class CG1Packet;
00030
00031
00032 class CPongCache
00033 {
00034
00035 public:
00036 CPongCache();
00037 virtual ~CPongCache();
00038
00039
00040 protected:
00041 CPtrList m_pCache;
00042 DWORD m_nTime;
00043
00044
00045 public:
00046 void Clear();
00047 BOOL ClearIfOld();
00048 CPongItem* Add(CNeighbour* pNeighbour, IN_ADDR* pAddress, WORD nPort, BYTE nHops, DWORD nFiles, DWORD nVolume);
00049 CPongItem* Lookup(CNeighbour* pNotFrom, BYTE nHops, CPtrList* pIgnore);
00050 public:
00051 POSITION GetIterator() const;
00052 CPongItem* GetNext(POSITION& pos) const;
00053
00054 };
00055
00056
00057 class CPongItem
00058 {
00059
00060 public:
00061 CPongItem(CNeighbour* pNeighbour, IN_ADDR* pAddress, WORD nPort, BYTE nHops, DWORD nFiles, DWORD nVolume);
00062 virtual ~CPongItem();
00063
00064
00065 public:
00066 CNeighbour* m_pNeighbour;
00067 IN_ADDR m_pAddress;
00068 WORD m_nPort;
00069 BYTE m_nHops;
00070 DWORD m_nFiles;
00071 DWORD m_nVolume;
00072
00073
00074 public:
00075 CG1Packet* ToPacket(int nTTL = 0, GGUID* pGUID = NULL);
00076
00077 };
00078
00079 #endif // !defined(AFX_PONGCACHE_H__0F9B689A_5132_49EB_8F13_670563C80A1D__INCLUDED_)