ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TLockFile.h
Go to the documentation of this file.
1 // @(#)root/io:$Id$
2 // Author: Jan Fiete Grosse-Oetringhaus, 04.06.07
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TLockFile
13 #define ROOT_TLockFile
14 
15 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18 #ifndef ROOT_TString
19 #include "TString.h"
20 #endif
21 
22 
23 class TLockFile : public TObject {
24 
25 private:
26  TLockFile(const TLockFile&); // not implemented
27  TLockFile& operator=(const TLockFile&); // not implemented
28 
29 protected:
30  TString fPath; ///< Path to file holding the lock
31 
32  Bool_t Lock(const char *path, Int_t timeLimit);
33 
34 public:
35  TLockFile(const char *path, Int_t timeLimit = 0);
36  virtual ~TLockFile();
37 
38  ClassDef(TLockFile, 0) //Lock an object using a file
39 };
40 
41 #endif
Basic string class.
Definition: TString.h:137
TLockFile(const TLockFile &)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:254
TLockFile & operator=(const TLockFile &)
A scoped lock based on files.
Definition: TLockFile.h:23
virtual ~TLockFile()
Destructor. Releases the lock.
Definition: TLockFile.cxx:58
Mother of all ROOT objects.
Definition: TObject.h:58
Bool_t Lock(const char *path, Int_t timeLimit)
Internal function that locks with the given path.
Definition: TLockFile.cxx:69
TString fPath
Path to file holding the lock.
Definition: TLockFile.h:30