simple_lock Class Reference

A simple locking mechanism. More...

#include <fs.h>

List of all members.

Public Types

typedef pid_t pid_type

Public Member Functions

 simple_lock ()
 C'tor.
 simple_lock (const std::string &a_lockfile)
 C'tor.
 ~simple_lock ()
 D'tor.
void clear (void)
 Clear the simple_lock object.
void lockfile (const std::string &a_lockfile)
 Set the lockfile path.
const std::string lockfile (void) const
 Get the lockfile path.
const pid_type locked_by (void) const
 Get the PID of the locking process.
const bool is_locked (void) const
 Find out whether or not the lock is in place.
bool lock (void)
 Lock.
void unlock (void)
 Unlock.

Private Attributes

std::string m_lockfile

Detailed Description

A simple locking mechanism.

Definition at line 343 of file fs.h.


Member Typedef Documentation

typedef pid_t simple_lock::pid_type

Definition at line 345 of file fs.h.


Constructor & Destructor Documentation

simple_lock::simple_lock (  ) 

C'tor.

Definition at line 1673 of file fs.cc.

References clear().

Here is the call graph for this function:

simple_lock::simple_lock ( const std::string &  a_lockfile  ) 

C'tor.

Definition at line 1679 of file fs.cc.

References clear(), and lockfile().

Here is the call graph for this function:

simple_lock::~simple_lock (  ) 

D'tor.

Definition at line 1686 of file fs.cc.

References clear().

Here is the call graph for this function:


Member Function Documentation

void simple_lock::clear ( void   ) 

Clear the simple_lock object.

Definition at line 1692 of file fs.cc.

References is_locked(), locked_by(), m_lockfile, and unlock().

Referenced by vault_manager::clear(), lock(), lockfile(), vault_manager::select(), simple_lock(), and ~simple_lock().

Here is the call graph for this function:

const bool simple_lock::is_locked ( void   )  const

Find out whether or not the lock is in place.

Definition at line 1733 of file fs.cc.

References locked_by(), and pid().

Referenced by clear(), lock(), vault_manager::select(), and test_simple_lock().

Here is the call graph for this function:

bool simple_lock::lock ( void   ) 

Lock.

Definition at line 1746 of file fs.cc.

References clear(), is_locked(), m_lockfile, and pid().

Referenced by vault_manager::select(), and test_simple_lock().

Here is the call graph for this function:

const simple_lock::pid_type simple_lock::locked_by ( void   )  const

Get the PID of the locking process.

Definition at line 1714 of file fs.cc.

References exists(), m_lockfile, and pid().

Referenced by clear(), is_locked(), vault_manager::select(), and test_simple_lock().

Here is the call graph for this function:

const std::string simple_lock::lockfile ( void   )  const

Get the lockfile path.

Definition at line 1708 of file fs.cc.

References m_lockfile.

Referenced by simple_lock().

void simple_lock::lockfile ( const std::string &  a_lockfile  ) 

Set the lockfile path.

Definition at line 1701 of file fs.cc.

References clear(), and m_lockfile.

Referenced by vault_manager::select(), and test_simple_lock().

Here is the call graph for this function:

void simple_lock::unlock ( void   ) 

Unlock.

Definition at line 1766 of file fs.cc.

References exists(), m_lockfile, rm_file(), TRY, and TRY_nomem.

Referenced by clear(), and test_simple_lock().

Here is the call graph for this function:


Member Data Documentation

std::string simple_lock::m_lockfile [private]

Definition at line 361 of file fs.h.

Referenced by clear(), lock(), locked_by(), lockfile(), and unlock().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Thu Sep 30 14:09:51 2010 for rvm by  doxygen 1.6.1