# BamCacheRecord

from pandac.PandaModules import BamCacheRecord

Class : BamCacheRecord
Description : An instance of this class is written to the front of a Bam or Txo file to make the file a cached instance of some other loadable resource. This record contains information needed to test the validity of the cache.

## Inheritance:

BamCacheRecord: TypedWritableReferenceCount LinkedListNode
TypedWritableReferenceCount: TypedWritable ReferenceCount
TypedWritable: TypedObject
TypedObject:
ReferenceCount:
LinkedListNode:

## Methods of BamCacheRecord:

addDependentFile
clearData
clearDependentFiles
dependentsUnchanged
extractData
getCacheFilename
getClassType
getData
getDependentPathname
getNumDependentFiles
getRecordedTime
getSourcePathname
hasData
makeCopy
operator ==
output
setData
write

## Methods of TypedWritableReferenceCount:

getClassType

## Methods of TypedWritable:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

addDependentFile void BamCacheRecord::add_dependent_file(Filename const &pathname); Description: Adds the indicated file to the list of files that will be loaded to generate the data in this record. This should be called once for the primary source file, and again for each secondary source file, if any.

clearData void BamCacheRecord::clear_data(void); Description: Removes the in-memory data object associated with this record, if any. This does not affect the on-disk representation of the record.

clearDependentFiles void BamCacheRecord::clear_dependent_files(void); Description: Empties the list of files that contribute to the data in this record.

dependentsUnchanged bool BamCacheRecord::dependents_unchanged(void) const; Description: Returns true if all of the dependent files are still the same as when the cache was recorded, false otherwise.

extractData TypedWritable *BamCacheRecord::extract_data(void); Description: Removes the in-memory data object associated with this record, and returns it. This transfers ownership of the data pointer; the caller will be responsible for subsequently deleting this object. It is an error to call this if the record does not own the pointer.

getCacheFilename Filename const &BamCacheRecord::get_cache_filename(void) const; Description: Returns the name of the cache file as hashed from the source_pathname. This will be relative to the root of the cache directory, and it will not include any suffixes that may be appended to resolve hash conflicts.

getClassType static TypeHandle BamCacheRecord::get_class_type(void); Undocumented function.

getData TypedWritable const *BamCacheRecord::get_data(void) const; Description: Returns a read-only pointer to the data stored in the record, or NULL if there is no data. This does not change ownership of the data pointer.

getDependentPathname Filename const &BamCacheRecord::get_dependent_pathname(int n) const; Description: Returns the full pathname of the nth source files that contributes to the cache.

getNumDependentFiles int BamCacheRecord::get_num_dependent_files(void) const; Description: Returns the number of source files that contribute to the cache.

getRecordedTime unsigned int BamCacheRecord::get_recorded_time(void) const; Description: Returns the time at which this particular record was recorded or updated.

getSourcePathname Filename const &BamCacheRecord::get_source_pathname(void) const; Description: Returns the full pathname to the source file that originally generated this cache request. In some cases, for instance in the case of a of a multipage texture like "cube_#.png", this may not not a true filename on disk.

hasData bool BamCacheRecord::has_data(void) const; Description: Returns true if this cache record has an in-memory data object associated--that is, the object stored in the cache.

makeCopy PointerTo< BamCacheRecord > BamCacheRecord::make_copy(void) const; Filename: bamCacheRecord.I Created by: drose (09Jun06) PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ . To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net . Description: Returns a duplicate of the BamCacheRecord. The duplicate will not have a data pointer set, even though one may have been assigned to the original via set_data().

operator == bool BamCacheRecord::operator ==(BamCacheRecord const &other) const; Description: Returns true if the record matches the other record in those attributes which get written to disk. Does not compare the data pointer.

output void BamCacheRecord::output(ostream &out) const; Description:

setData void BamCacheRecord::set_data(TypedWritable *data, bool owns_pointer); Description: Stores a new data object on the record. If owns_pointer is true, the record owns the pointer, and will eventually be responsible for deleting it.

write void BamCacheRecord::write(ostream &out, int indent_level = (0)) const; Description:

getClassType static TypeHandle TypedWritableReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedWritable::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is true if the new reference count is nonzero, false if it is zero.