PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...
#include "bamCache.h"
#include "bamCacheIndex.h"
#include "bamReader.h"
#include "bamWriter.h"
#include "hashVal.h"
#include "datagramInputFile.h"
#include "datagramOutputFile.h"
#include "config_putil.h"
#include "bam.h"
#include "typeRegistry.h"
#include "string_utils.h"
#include "configVariableInt.h"
#include "configVariableString.h"
#include "configVariableFilename.h"
#include "virtualFileSystem.h"
Go to the source code of this file.
Functions | |
PT (BamCacheRecord) BamCache | |
Looks up a file in the cache. More... | |
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
All rights reserved.
All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."
Definition in file bamCache.cxx.
PT | ( | BamCacheRecord | ) |
Looks up a file in the cache.
Actually reads a record from the file.
Reads the indicated cache file and returns its associated record if it can be read and it matches the source filename.
Looks for the existing cache file that corresponds to the indicated filename.
If the file is cacheable, then regardless of whether the file is found in the cache or not, this returns a BamCacheRecord. On the other hand, if the file cannot be cached, returns NULL.
If record->has_data() returns true, then the file was found in the cache, and you may call record->extract_data() to get the object. If record->has_data() returns false, then the file was not found in the cache or the cache was stale; and you should reload the source file (calling record->add_dependent_file() for each file loaded, including the original source file), and then call record->set_data() to record the resulting loaded object; and finally, you should call store() to write the cached record to disk.
Normally, this is the specified cache filename exactly; but in the case of a hash collision, it may be a variant of the cache filename.
Definition at line 158 of file bamCache.cxx.