HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FS_DiskCache::Accessor Class Reference

#include <FS_DiskCache.h>

+ Inheritance diagram for FS_DiskCache::Accessor:

Public Member Functions

 Accessor ()
 
 ~Accessor ()
 
void clear ()
 
bool write (const void *data, exint len)
 Write data to the file. This method can be called multiple times. More...
 
bool write (const UT_WorkBuffer &buf)
 Convenience methods to write data to the cache. More...
 
exint bytesWritten () const
 Return the number of bytes written. More...
 
bool read (UT_WorkBuffer &contents) const
 Read the contents of the stream. More...
 
bool isValid () const
 Whether the accessor is valid. More...
 
bool isRead () const
 Whether the accessor was opened as read-only. More...
 
bool isWrite () const
 Whether the accessor was opened for writing. More...
 
const UT_StringHolderfilename () const
 Return the full path of the file in the cache. More...
 
void storeInCache (bool v)
 
void dump () const
 
void dump (UT_JSONWriter &w) const
 

Friends

class FS_DiskCache
  More...
 

Additional Inherited Members

- Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable
 UT_NonCopyable ()=default
 
 ~UT_NonCopyable ()=default
 
 UT_NonCopyable (const UT_NonCopyable &)=delete
 
UT_NonCopyableoperator= (const UT_NonCopyable &)=delete
 

Detailed Description

The Accessor class is used to access items in the cache. When an accessor is in write-mode, the thread/process will have unique access to the cache item until the Accessor is destructed. Multiple threads/processes can have read-only access to the item.

Definition at line 56 of file FS_DiskCache.h.

Constructor & Destructor Documentation

FS_DiskCache::Accessor::Accessor ( )
inline

Definition at line 59 of file FS_DiskCache.h.

FS_DiskCache::Accessor::~Accessor ( )
inline

Definition at line 69 of file FS_DiskCache.h.

Member Function Documentation

exint FS_DiskCache::Accessor::bytesWritten ( ) const
inline

Return the number of bytes written.

Definition at line 86 of file FS_DiskCache.h.

void FS_DiskCache::Accessor::clear ( )

Clear the accessor. This will close any file descriptors and release any locks.

void FS_DiskCache::Accessor::dump ( ) const
void FS_DiskCache::Accessor::dump ( UT_JSONWriter w) const
const UT_StringHolder& FS_DiskCache::Accessor::filename ( ) const
inline

Return the full path of the file in the cache.

Definition at line 101 of file FS_DiskCache.h.

bool FS_DiskCache::Accessor::isRead ( ) const
inline

Whether the accessor was opened as read-only.

Definition at line 95 of file FS_DiskCache.h.

bool FS_DiskCache::Accessor::isValid ( ) const
inline

Whether the accessor is valid.

Definition at line 92 of file FS_DiskCache.h.

bool FS_DiskCache::Accessor::isWrite ( ) const
inline

Whether the accessor was opened for writing.

Definition at line 98 of file FS_DiskCache.h.

bool FS_DiskCache::Accessor::read ( UT_WorkBuffer contents) const

Read the contents of the stream.

void FS_DiskCache::Accessor::storeInCache ( bool  v)
inline

Normally, accessors that write data are counted to the cache storage. This can disable this behaviour.

Definition at line 105 of file FS_DiskCache.h.

bool FS_DiskCache::Accessor::write ( const void data,
exint  len 
)

Write data to the file. This method can be called multiple times.

bool FS_DiskCache::Accessor::write ( const UT_WorkBuffer buf)
inline

Convenience methods to write data to the cache.

Definition at line 82 of file FS_DiskCache.h.

Friends And Related Function Documentation

friend class FS_DiskCache
friend

Definition at line 115 of file FS_DiskCache.h.


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