#include <file_lock_resource.h>
Classes | |
class | wouldblock |
Public Member Functions | |
file_lock_resource () | |
file_lock_resource (const std::string &__file, const std::string &__mode="r", int __cmd=F_SETLKW, short __type=F_RDLCK, bool __dbg=false) | |
void | acquire (const std::string &__file, const std::string &__mode="r", int __cmd=F_SETLKW, short __type=F_RDLCK, bool __dbg=false) throw ( runtime_error, wouldblock ) |
void | release () throw (runtime_error) |
virtual | ~file_lock_resource () |
operator FILE * () | |
const std::string & | filename () const |
Public Attributes | |
bool | dbg |
File locking resource implemented with fcntl()/POSIX locking API
fcntl()/POSIX locking also works with NFS.
Definition at line 37 of file file_lock_resource.h.
rostlab::file_lock_resource::file_lock_resource | ( | ) | [inline] |
Definition at line 52 of file file_lock_resource.h.
rostlab::file_lock_resource::file_lock_resource | ( | const std::string & | __file, |
const std::string & | __mode = "r" , |
||
int | __cmd = F_SETLKW , |
||
short | __type = F_RDLCK , |
||
bool | __dbg = false |
||
) | [inline] |
__mode: "r", "r+", "w", "w+", "a", "a+"; __cmd: F_SETLK, F_SETLKW; __type: F_RDLCK, F_WRLCK
Definition at line 56 of file file_lock_resource.h.
virtual rostlab::file_lock_resource::~file_lock_resource | ( | ) | [inline, virtual] |
Definition at line 98 of file file_lock_resource.h.
void rostlab::file_lock_resource::acquire | ( | const std::string & | __file, |
const std::string & | __mode = "r" , |
||
int | __cmd = F_SETLKW , |
||
short | __type = F_RDLCK , |
||
bool | __dbg = false |
||
) | throw ( runtime_error, wouldblock ) [inline] |
Definition at line 61 of file file_lock_resource.h.
const std::string& rostlab::file_lock_resource::filename | ( | ) | const [inline] |
Definition at line 106 of file file_lock_resource.h.
rostlab::file_lock_resource::operator FILE * | ( | ) | [inline] |
Definition at line 103 of file file_lock_resource.h.
void rostlab::file_lock_resource::release | ( | ) | throw (runtime_error) [inline] |
Definition at line 87 of file file_lock_resource.h.
Definition at line 45 of file file_lock_resource.h.