Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
qtmcache.h
Package: 142_61_thumb_advanced.rar [view]
Upload User: dangjiwu
Upload Date: 2013-07-19
Package Size: 42019k
Code Size: 2k
Category:
Symbian
Development Platform:
Visual C++
- /****************************************************************************
- *
- * $Id: qtmcache.h,v 1.1 2003/03/30 22:17:13 milko Exp $
- *
- * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
- *
- * http://www.real.com/devzone
- *
- * This program contains proprietary
- * information of Progressive Networks, Inc, and is licensed
- * subject to restrictions on use and distribution.
- *
- *
- * Memory Cache
- *
- */
- #ifndef _QTMCACHE_H_
- #define _QTMCACHE_H_
- /****************************************************************************
- * Defines
- */
- /****************************************************************************
- * Includes
- */
- #include "hxtypes.h"
- #include "hxcom.h"
- #include "hxcomm.h"
- #include "ihxpckts.h"
- /****************************************************************************
- *
- * Class:
- * CQTMemCache
- *
- * Purpose:
- * Enables paging of file sections into memory
- *
- */
- class CQTMemCache
- {
- public:
- /*
- * Constructor/Destructor
- */
- CQTMemCache(void)
- : m_pBuffer(NULL)
- , m_ulBaseOffset(0)
- , m_ulEndOffset(0)
- , m_bEnabled(TRUE)
- {
- ;
- }
- ~CQTMemCache()
- {
- HX_RELEASE(m_pBuffer);
- }
- /*
- * IUnknown methods
- */
- void SetPage(ULONG32 ulBaseOffset, IHXBuffer* pBuffer)
- {
- if (m_pBuffer)
- {
- m_pBuffer->Release();
- }
- m_pBuffer = pBuffer;
- pBuffer->AddRef();
- m_ulBaseOffset = ulBaseOffset;
- m_ulEndOffset = ulBaseOffset + m_pBuffer->GetSize();
- }
- void ReleasePage(void)
- {
- HX_RELEASE(m_pBuffer);
- }
- BOOL IsInPage(ULONG32 ulBaseOffset, ULONG32 ulSize)
- {
- return (m_pBuffer &&
- (((LONG32) (ulBaseOffset - m_ulBaseOffset)) >= 0) &&
- (((LONG32) (m_ulEndOffset - ulBaseOffset - ulSize)) >= 0));
- }
- // COM semantics is not followed here (no AddRef of pBuffer)
- // for efficiency reasons.
- void Get(ULONG32 ulBaseOffset,
- IHXBuffer* &pBuffer, ULONG32 &ulPageOffset)
- {
- pBuffer = m_pBuffer;
- ulPageOffset = ulBaseOffset - m_ulBaseOffset;
- }
- BOOL IsEnabled(void) { return m_bEnabled; }
- void Enable(BOOL bEnable) { m_bEnabled = bEnable; }
- private:
- IHXBuffer* m_pBuffer;
- ULONG32 m_ulBaseOffset;
- ULONG32 m_ulEndOffset;
- BOOL m_bEnabled;
- };
- #endif // _QTMCACHE_H_