wibble  1.1
lockfile.h
Go to the documentation of this file.
1 #ifndef WIBBLE_SYS_LOCKFILE_H
2 #define WIBBLE_SYS_LOCKFILE_H
3 
4 #include <wibble/sys/macros.h>
5 #include <string>
6 
7 namespace wibble {
8 namespace sys {
9 namespace fs {
10 
17 struct Lockfile
18 {
19  std::string name;
20  int fd;
21 
28  Lockfile(const std::string& name, bool write = true);
29  ~Lockfile();
30 
31 private:
32  // Disallow copying
33  Lockfile(const Lockfile&);
34  Lockfile& operator=(const Lockfile&);
35 };
36 
37 }
38 }
39 }
40 
41 // vim:set ts=4 sw=4:
42 #endif
int fd
Definition: lockfile.h:20
RAII lock file.
Definition: lockfile.h:17
std::string name
Definition: lockfile.h:19
Lockfile(const std::string &name, bool write=true)
Create the lockfile with the given name.
Definition: amorph.h:17