Logo ROOT  
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
19class TLockFile : public TObject {
20
21private:
22 TLockFile(const TLockFile&) = delete; // not implemented
23 TLockFile& operator=(const TLockFile&) = delete; // not implemented
24
25protected:
26 TString fPath; ///< Path to file holding the lock
27
28 Bool_t Lock(const char *path, Int_t timeLimit);
29
30public:
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
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:326
A scoped lock based on files.
Definition: TLockFile.h:19
virtual ~TLockFile()
Destructor. Releases the lock.
Definition: TLockFile.cxx:58
TString fPath
Path to file holding the lock.
Definition: TLockFile.h:26
TLockFile(const TLockFile &)=delete
Bool_t Lock(const char *path, Int_t timeLimit)
Internal function that locks with the given path.
Definition: TLockFile.cxx:69
TLockFile & operator=(const TLockFile &)=delete
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:131