www.mooseframework.org
LockFile.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef LOCKFILE_H
16 #define LOCKFILE_H
17 
18 #include <string>
19 
28 class LockFile
29 {
30 public:
31  LockFile(const std::string & filename, bool do_lock = true);
32  ~LockFile();
33 
34 protected:
35  const bool _do_lock;
36  int _fd;
37  const std::string _filename;
38 };
39 
40 #endif // LOCKFILE_H
const std::string _filename
Definition: LockFile.h:37
int _fd
Definition: LockFile.h:36
const bool _do_lock
Definition: LockFile.h:35
~LockFile()
Definition: LockFile.C:34
Gets an exclusive lock on a file.
Definition: LockFile.h:28
LockFile(const std::string &filename, bool do_lock=true)
Definition: LockFile.C:21