PCL
pcl::FileDataCacheItem Class Reference

Element of a file data cache. More...

#include <FileDataCache.h>

Public Member Functions

virtual ~FileDataCacheItem ()
 
void Assign (const FileDataCacheItem &item)
 
double DaysSinceLastUsed () const
 
bool ModifiedSince (FileTime t) const
 
bool operator< (const FileDataCacheItem &item) const
 
bool operator== (const FileDataCacheItem &item) const
 

Public Attributes

IsoString key
 Cache key. Allows different cache entries for the same file.
 
TimePoint lastUsed
 Time this cache item was last used.
 
String path
 Full path to the file represented by this item.
 
TimePoint time
 Cached file time.
 

Protected Member Functions

 FileDataCacheItem (const FileDataCacheItem &)=default
 
virtual void AssignData (const FileDataCacheItem &item)
 
virtual bool DeserializeData (const IsoStringList &tokens)
 
virtual IsoStringList SerializedData () const
 
virtual bool ValidateData () const
 

Static Protected Member Functions

static bool DeserializeMatrices (Array< DMatrix > &matrices, IsoStringList::const_iterator &start, const IsoStringList &tokens)
 
static bool DeserializeMatrix (DMatrix &matrix, IsoStringList::const_iterator &start, const IsoStringList &tokens)
 
static bool DeserializeMultiVector (DMultiVector &multivector, IsoStringList::const_iterator &start, const IsoStringList &tokens)
 
static bool DeserializeVector (DVector &vector, IsoStringList::const_iterator &start, const IsoStringList &tokens)
 
static IsoStringList SerializedMatrices (const Array< DMatrix > &matrices)
 
static IsoStringList SerializedMatrix (const DMatrix &matrix)
 
static IsoStringList SerializedMultiVector (const DMultiVector &multivector)
 
static IsoStringList SerializedVector (const DVector &vector)
 

Detailed Description

This class represents a file in a FileDataCache object. This is a basic cache item structure to transport a file's full path, known time of last modification, and the time of last cache access.

Reimplementing this class is normally necessary to store additional data associated with cached files.

See also
FileDataCache

Definition at line 83 of file FileDataCache.h.

Constructor & Destructor Documentation

◆ ~FileDataCacheItem()

virtual pcl::FileDataCacheItem::~FileDataCacheItem ( )
inlinevirtual

Virtual destructor.

Definition at line 95 of file FileDataCache.h.

◆ FileDataCacheItem()

pcl::FileDataCacheItem::FileDataCacheItem ( const FileDataCacheItem )
protecteddefault

Copy constructor.

Member Function Documentation

◆ Assign()

void pcl::FileDataCacheItem::Assign ( const FileDataCacheItem item)
inline

Assigns data from another cache item.

Definition at line 102 of file FileDataCache.h.

References key, lastUsed, path, and time.

◆ AssignData()

virtual void pcl::FileDataCacheItem::AssignData ( const FileDataCacheItem item)
inlineprotectedvirtual

Assigns additional data stored in another file cache item.

The default implementation does nothing. This virtual member function should be reimplemented by derived classes, when necessary, to ensure persistence of reimplementation-specific data.

Definition at line 163 of file FileDataCache.h.

◆ DaysSinceLastUsed()

double pcl::FileDataCacheItem::DaysSinceLastUsed ( ) const
inline

Returns the amount of days elapsed since the time this cache item was last used.

Definition at line 149 of file FileDataCache.h.

References pcl::TimePoint::Now().

◆ DeserializeData()

virtual bool pcl::FileDataCacheItem::DeserializeData ( const IsoStringList tokens)
inlineprotectedvirtual

Retrieves additional data from an ordered list of UTF-8 string tokens. Returns true iff the data were successfully retrieved.

The default implementation returns true. This virtual member function should be reimplemented by derived classes when necessary for retrieval of reimplementation-specific data.

Definition at line 188 of file FileDataCache.h.

◆ DeserializeMatrices()

static bool pcl::FileDataCacheItem::DeserializeMatrices ( Array< DMatrix > &  matrices,
IsoStringList::const_iterator start,
const IsoStringList tokens 
)
staticprotected

Deserializes an array of floating-point matrices from the specified ordered list of tokens, parsing the necessary tokens starting from the specified start iterator.

◆ DeserializeMatrix()

static bool pcl::FileDataCacheItem::DeserializeMatrix ( DMatrix matrix,
IsoStringList::const_iterator start,
const IsoStringList tokens 
)
staticprotected

Deserializes a floating-point matrix from the specified ordered list of tokens, parsing the necessary tokens starting from the specified start iterator.

◆ DeserializeMultiVector()

static bool pcl::FileDataCacheItem::DeserializeMultiVector ( DMultiVector multivector,
IsoStringList::const_iterator start,
const IsoStringList tokens 
)
staticprotected

Deserializes a floating-point multivector from the specified ordered list of tokens, parsing the necessary tokens starting from the specified start iterator.

◆ DeserializeVector()

static bool pcl::FileDataCacheItem::DeserializeVector ( DVector vector,
IsoStringList::const_iterator start,
const IsoStringList tokens 
)
staticprotected

Deserializes a floating-point vector from the specified ordered list of tokens, parsing the necessary tokens starting from the specified start iterator.

◆ ModifiedSince()

bool pcl::FileDataCacheItem::ModifiedSince ( FileTime  t) const
inline

Returns true iff the file represented by this cache item was last modified before the specified file time t.

Note
This member function ignores the milliseconds component of the specified FileTime instance, by setting it to zero. This is done to prevent wrong cache invalidations caused by unreliable file time milliseconds on Windows.

Definition at line 139 of file FileDataCache.h.

References pcl::FileTime::milliseconds.

◆ operator<()

bool pcl::FileDataCacheItem::operator< ( const FileDataCacheItem item) const
inline

Returns true iff this object precedes another cache item. File cache items are sorted by full file paths in ascending order.

Definition at line 123 of file FileDataCache.h.

References key, and path.

◆ operator==()

bool pcl::FileDataCacheItem::operator== ( const FileDataCacheItem item) const
inline

Returs true iff this object represents the same file as another cache item.

Definition at line 114 of file FileDataCache.h.

References path.

◆ SerializedData()

virtual IsoStringList pcl::FileDataCacheItem::SerializedData ( ) const
inlineprotectedvirtual

Returns an ordered list of UTF-8 strings representing the additional data stored in this cache item.

The default implementation returns an empty string list. This virtual member function should be reimplemented by derived classes when necessary to allow this root base class to access reimplementation-specific data.

Definition at line 175 of file FileDataCache.h.

◆ SerializedMatrices()

static IsoStringList pcl::FileDataCacheItem::SerializedMatrices ( const Array< DMatrix > &  matrices)
staticprotected

Returns a string list serialization of an array of floating-point matrices.

◆ SerializedMatrix()

static IsoStringList pcl::FileDataCacheItem::SerializedMatrix ( const DMatrix matrix)
staticprotected

Returns a string list serialization of a floating-point matrix.

◆ SerializedMultiVector()

static IsoStringList pcl::FileDataCacheItem::SerializedMultiVector ( const DMultiVector multivector)
staticprotected

Returns a string list serialization of a floating-point multivector.

◆ SerializedVector()

static IsoStringList pcl::FileDataCacheItem::SerializedVector ( const DVector vector)
staticprotected

Returns a string list serialization of a floating-point vector.

◆ ValidateData()

virtual bool pcl::FileDataCacheItem::ValidateData ( ) const
inlineprotectedvirtual

Returns true iff the additional data stored in this cache item is valid.

The default implementation returns true. This virtual member function should be reimplemented by derived classes, when necessary, for the validation of reimplementation-specific data.

Definition at line 200 of file FileDataCache.h.


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