Logo ROOT   6.12/07
Reference Guide
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 #include "TObject.h"
16 #include "TString.h"
17 
18 
19 class TLockFile : public TObject {
20 
21 private:
22  TLockFile(const TLockFile&); // not implemented
23  TLockFile& operator=(const TLockFile&); // not implemented
24 
25 protected:
26  TString fPath; ///< Path to file holding the lock
27 
28  Bool_t Lock(const char *path, Int_t timeLimit);
29 
30 public:
31  TLockFile(const char *path, Int_t timeLimit = 0);
32  virtual ~TLockFile();
33 
34  ClassDef(TLockFile, 0) //Lock an object using a file
35 };
36 
37 #endif
Basic string class.
Definition: TString.h:125
TLockFile(const TLockFile &)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:320
TLockFile & operator=(const TLockFile &)
A scoped lock based on files.
Definition: TLockFile.h:19
virtual ~TLockFile()
Destructor. Releases the lock.
Definition: TLockFile.cxx:58
Mother of all ROOT objects.
Definition: TObject.h:37
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:26