• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

P_RamCache.h

Go to the documentation of this file.
00001 /** @file
00002 
00003   A brief file description
00004 
00005   @section license License
00006 
00007   Licensed to the Apache Software Foundation (ASF) under one
00008   or more contributor license agreements.  See the NOTICE file
00009   distributed with this work for additional information
00010   regarding copyright ownership.  The ASF licenses this file
00011   to you under the Apache License, Version 2.0 (the
00012   "License"); you may not use this file except in compliance
00013   with the License.  You may obtain a copy of the License at
00014 
00015       http://www.apache.org/licenses/LICENSE-2.0
00016 
00017   Unless required by applicable law or agreed to in writing, software
00018   distributed under the License is distributed on an "AS IS" BASIS,
00019   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020   See the License for the specific language governing permissions and
00021   limitations under the License.
00022  */
00023 
00024 #ifndef _P_RAM_CACHE_H__
00025 #define _P_RAM_CACHE_H__
00026 
00027 #include "I_Cache.h"
00028 
00029 // Generic Ram Cache interface
00030 
00031 struct RamCache {
00032   // returns 1 on found/stored, 0 on not found/stored, if provided auxkey1 and auxkey2 must match
00033   virtual int get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, uint32_t auxkey1 = 0, uint32_t auxkey2 = 0) = 0;
00034   virtual int put(INK_MD5 *key, IOBufferData *data, uint32_t len, bool copy = false, uint32_t auxkey1 = 0, uint32_t auxkey2 = 0) = 0;
00035   virtual int fixup(INK_MD5 *key, uint32_t old_auxkey1, uint32_t old_auxkey2, uint32_t new_auxkey1, uint32_t new_auxkey2) = 0;
00036 
00037   virtual void init(int64_t max_bytes, Vol *vol) = 0;
00038   virtual ~RamCache() {};
00039 };
00040 
00041 RamCache *new_RamCacheLRU();
00042 RamCache *new_RamCacheCLFUS();
00043 
00044 #endif /* _P_RAM_CACHE_H__ */

Generated by  doxygen 1.7.1