Back to index

tetex-bin  3.0
Public Member Functions | Private Attributes
CMapCache Class Reference

#include <CMap.h>

Collaboration diagram for CMapCache:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CMapCache ()
 ~CMapCache ()
CMapgetCMap (GString *collection, GString *cMapName)

Private Attributes

CMapcache [cMapCacheSize]

Detailed Description

Definition at line 85 of file CMap.h.


Constructor & Destructor Documentation

Definition at line 335 of file CMap.cc.

                     {
  int i;

  for (i = 0; i < cMapCacheSize; ++i) {
    cache[i] = NULL;
  }
}

Definition at line 343 of file CMap.cc.

                      {
  int i;

  for (i = 0; i < cMapCacheSize; ++i) {
    if (cache[i]) {
      cache[i]->decRefCnt();
    }
  }
}

Here is the call graph for this function:


Member Function Documentation

CMap * CMapCache::getCMap ( GString collection,
GString cMapName 
)

Definition at line 353 of file CMap.cc.

                                                               {
  CMap *cmap;
  int i, j;

  if (cache[0] && cache[0]->match(collection, cMapName)) {
    cache[0]->incRefCnt();
    return cache[0];
  }
  for (i = 1; i < cMapCacheSize; ++i) {
    if (cache[i] && cache[i]->match(collection, cMapName)) {
      cmap = cache[i];
      for (j = i; j >= 1; --j) {
       cache[j] = cache[j - 1];
      }
      cache[0] = cmap;
      cmap->incRefCnt();
      return cmap;
    }
  }
  if ((cmap = CMap::parse(this, collection, cMapName))) {
    if (cache[cMapCacheSize - 1]) {
      cache[cMapCacheSize - 1]->decRefCnt();
    }
    for (j = cMapCacheSize - 1; j >= 1; --j) {
      cache[j] = cache[j - 1];
    }
    cache[0] = cmap;
    cmap->incRefCnt();
    return cmap;
  }
  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 99 of file CMap.h.


The documentation for this class was generated from the following files: