cheshirekow  v0.1.0
fontconfig::AtomicDelegate Class Reference

Used for locking access to configuration files. Provides a safe way to update configuration files. More...

#include <cpp_fontconfig/Atomic.h>

Public Member Functions

void deleteNew ()
 delete new file More...
 
void destroy ()
 destroy an FcAtomic object More...
 
bool lock ()
 lock a file More...
 
Char8_tnewFile ()
 return new temporary file name More...
 
AtomicDelegateoperator-> ()
 
const AtomicDelegateoperator-> () const
 
Char8_torigFile ()
 return original file name More...
 
bool replaceOrig ()
 replace original with new More...
 
void unlock ()
 unlock a file More...
 

Private Member Functions

 AtomicDelegate (FcAtomic *ptr)
 wrap constructor More...
 
 AtomicDelegate (const AtomicDelegate &other)
 not copy-constructable More...
 
AtomicDelegateoperator= (const AtomicDelegate &other)
 not assignable More...
 

Private Attributes

FcAtomic * m_ptr
 

Friends

class RefPtr< Atomic >
 

Detailed Description

Used for locking access to configuration files. Provides a safe way to update configuration files.

These functions provide a safe way to update configuration files, allowing ongoing reading of the old configuration file while locked for writing and ensuring that a consistent and complete version of the configuration file is always available.

Definition at line 47 of file Atomic.h.

Constructor & Destructor Documentation

fontconfig::AtomicDelegate::AtomicDelegate ( FcAtomic *  ptr)
inlineexplicitprivate

wrap constructor

wraps the pointer with this interface, does nothing else, only called by RefPtr<Atomic>

Definition at line 57 of file Atomic.h.

fontconfig::AtomicDelegate::AtomicDelegate ( const AtomicDelegate other)
private

not copy-constructable

Member Function Documentation

void fontconfig::AtomicDelegate::deleteNew ( )

delete new file

Deletes the new file. Used in error recovery to back out changes.

void fontconfig::AtomicDelegate::destroy ( )

destroy an FcAtomic object

Destroys atomic.

bool fontconfig::AtomicDelegate::lock ( )

lock a file

Attempts to lock the file referenced by atomic. Returns FcFalse if the file is already locked, else returns FcTrue and leaves the file locked.

Char8_t* fontconfig::AtomicDelegate::newFile ( )

return new temporary file name

Returns the filename for writing a new version of the file referenced by atomic.

AtomicDelegate* fontconfig::AtomicDelegate::operator-> ( )
inline

Definition at line 70 of file Atomic.h.

const AtomicDelegate* fontconfig::AtomicDelegate::operator-> ( ) const
inline

Definition at line 71 of file Atomic.h.

AtomicDelegate& fontconfig::AtomicDelegate::operator= ( const AtomicDelegate other)
private

not assignable

Char8_t* fontconfig::AtomicDelegate::origFile ( )

return original file name

Returns the file referenced by atomic.

bool fontconfig::AtomicDelegate::replaceOrig ( )

replace original with new

Replaces the original file referenced by atomic with the new file. Returns FcFalse if the file cannot be replaced due to permission issues in the filesystem. Otherwise returns FcTrue.

void fontconfig::AtomicDelegate::unlock ( )

unlock a file

Unlocks the file.

Friends And Related Function Documentation

friend class RefPtr< Atomic >
friend

Definition at line 68 of file Atomic.h.

Member Data Documentation

FcAtomic* fontconfig::AtomicDelegate::m_ptr
private

Definition at line 50 of file Atomic.h.


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