36 INLINE
bool BamCacheRecord::
38 return (_source_pathname == other._source_pathname &&
39 _cache_filename == other._cache_filename &&
40 _recorded_time == other._recorded_time &&
41 _record_size == other._record_size);
55 return _source_pathname;
69 return _cache_filename;
82 return _source_timestamp;
93 return _recorded_time;
104 return _files.size();
115 nassertr(n >= 0 && n < (
int)_files.size(), _files[0]._pathname);
116 return _files[n]._pathname;
140 if (_ref_ptr != NULL) {
141 unref_delete(_ref_ptr);
203 if (_ref_ptr != NULL) {
217 nassertv(dummy == 0);
226 INLINE
bool BamCacheRecord::SortByAccessTime::
228 return (a->_record_access_time < b->_record_access_time);
void set_data(TypedWritable *ptr, ReferenceCount *ref_ptr)
Stores a new data object on the record.
Base class for objects that can be written to and read from Bam files.
const Filename & get_cache_filename() const
Returns the name of the cache file as hashed from the source_pathname.
int get_num_dependent_files() const
Returns the number of source files that contribute to the cache.
bool has_data() const
Returns true if this cache record has an in-memory data object associated–that is, the object stored in the cache.
time_t get_recorded_time() const
Returns the time at which this particular record was recorded or updated.
The name of a file, such as a texture file or an Egg file.
An instance of this class is written to the front of a Bam or Txo file to make the file a cached inst...
TypedWritable * get_data() const
Returns a pointer to the data stored in the record, or NULL if there is no data.
const Filename & get_source_pathname() const
Returns the full pathname to the source file that originally generated this cache request...
time_t get_source_timestamp() const
Returns the file timestamp of the original source file that generated this cache record, if available.
A base class for all things that want to be reference-counted.
const Filename & get_dependent_pathname(int n) const
Returns the full pathname of the nth source files that contributes to the cache.
bool extract_data(TypedWritable *&ptr, ReferenceCount *&ref_ptr)
Fills ptr and ref_ptr with the two different-typed pointers to the same object, the data stored withi...
void ref() const
Explicitly increments the reference count.
void clear_data()
Removes the in-memory data object associated with this record, if any.