Loading...
Searching...
No Matches
rostlab::file_lock_resource Class Reference

`#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

## Detailed Description

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.

## Constructor & Destructor Documentation

## file_lock_resource() [1/2]

rostlab::file_lock_resource::file_lock_resource | ( |  | ) |

inline

Definition at line 52 of file file_lock_resource.h.

## file_lock_resource() [2/2]

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.

## ~file_lock_resource()

virtual rostlab::file_lock_resource::~file_lock_resource | ( |  | ) |

inline virtual

Definition at line 98 of file file_lock_resource.h.

## Member Function Documentation

## acquire()

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.

## filename()

const std::string & rostlab::file_lock_resource::filename | ( |  | ) | const

inline

Definition at line 106 of file file_lock_resource.h.

## operator FILE *()

rostlab::file_lock_resource::operator FILE * | ( |  | ) |

inline

Definition at line 103 of file file_lock_resource.h.

## release()

void rostlab::file_lock_resource::release | ( |  | ) |
throw | ( | runtime_error ) |  |  |

inline

Definition at line 87 of file file_lock_resource.h.

## Member Data Documentation

## dbg

bool rostlab::file_lock_resource::dbg

Definition at line 47 of file file_lock_resource.h.

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

- rostlab/file_lock_resource.h