Home | History | Annotate | Download | only in leperf
      1 /*
      2  **********************************************************************
      3  *    2016 and later: Unicode, Inc. and others.
      4  *   License & terms of use: http://www.unicode.org/copyright.html#License
      5  **********************************************************************
      6  **********************************************************************
      7  *   Copyright (C) 2003-2013, International Business Machines
      8  *   Corporation and others.  All Rights Reserved.
      9  **********************************************************************
     10  */
     11 
     12 #ifndef __FONTTABLECACHE_H
     13 
     14 #define __FONTTABLECACHE_H
     15 
     16 #include "layout/LETypes.h"
     17 
     18 U_NAMESPACE_USE
     19 
     20 struct FontTableCacheEntry;
     21 
     22 class FontTableCache
     23 {
     24 public:
     25     FontTableCache();
     26 
     27     virtual ~FontTableCache();
     28 
     29     const void *find(LETag tableTag, size_t &length) const;
     30 
     31 protected:
     32     virtual const void *readFontTable(LETag tableTag, size_t &length) const = 0;
     33     virtual void freeFontTable(const void *table) const;
     34 
     35 private:
     36 
     37     void add(LETag tableTag, const void *table, size_t length);
     38 
     39     FontTableCacheEntry *fTableCache;
     40     le_int32 fTableCacheCurr;
     41     le_int32 fTableCacheSize;
     42 };
     43 
     44 #endif
     45 
     46