Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

PongCache.h

Go to the documentation of this file.
00001 //
00002 // PongCache.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 // Construction
00035 public:
00036         CPongCache();
00037         virtual ~CPongCache();
00038 
00039 // Attributes
00040 protected:
00041         CPtrList        m_pCache;
00042         DWORD           m_nTime;
00043 
00044 // Operations
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 // Construction
00060 public:
00061         CPongItem(CNeighbour* pNeighbour, IN_ADDR* pAddress, WORD nPort, BYTE nHops, DWORD nFiles, DWORD nVolume);
00062         virtual ~CPongItem();
00063 
00064 // Attributes
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 // Operations
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_)

Generated on Thu Dec 15 10:39:46 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2