CMS 3D CMS Logo

FileLock.h

Go to the documentation of this file.
00001 #ifndef CLASSLIB_FILE_LOCK_H
00002 # define CLASSLIB_FILE_LOCK_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "classlib/sysapi/IOTypes.h"
00007 
00008 namespace lat {
00009 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00010 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00011 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00012 
00013 class File;
00014 
00015 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00016 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00017 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00018 
00019 class FileLock
00020 {
00021 public:
00022     FileLock (void);
00023     FileLock (File *file, IOOffset pos, IOOffset len,
00024               bool write = true, bool wait = false);
00025     ~FileLock (void);
00026 
00027     void                lock (File *file,
00028                               IOOffset pos,
00029                               IOOffset length,
00030                               bool write = true,
00031                               bool wait = false);
00032     void                unlock (void);
00033     static bool         locked (File *file,
00034                                 IOOffset pos,
00035                                 IOOffset length,
00036                                 bool write = true);
00037 
00038 private:
00039     static void         unlock (File *file, IOOffset pos, IOOffset length);
00040 
00041     File                *m_file;
00042     IOOffset            m_offset;
00043     IOOffset            m_length;
00044 
00045     // undefined, no semantics (yet?)
00046     FileLock (const FileLock &);
00047     FileLock &operator= (const FileLock &);
00048 };
00049 
00050 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00051 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00052 
00053 } // namespace lat
00054 #endif // CLASSLIB_FILE_LOCK_H

Generated on Tue Jun 9 17:38:51 2009 for CMSSW by  doxygen 1.5.4