Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

wvlockdev.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*- 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 1997-2002 Net Integration Technologies, Inc. 00004 * 00005 * Some handy functions to create/remove /var/lock lockfiles. 00006 */ 00007 #ifndef __WVLOCKDEV_H 00008 #define __WVLOCKDEV_H 00009 00010 #include "wvstring.h" 00011 00012 /** 00013 * Class to handle Lock files - useful for WvDial and other places where we 00014 * need to guarantee exclusive access to a file or device. Creates/Removes 00015 * lockfiles in /var/lock. 00016 */ 00017 class WvLockDev 00018 { 00019 WvString devicename, filename; 00020 int lock_count; 00021 public: 00022 WvLockDev(WvString _devicename); 00023 ~WvLockDev(); 00024 00025 bool lock(); 00026 void unlock(); 00027 bool islocked() const 00028 { return lock_count != 0; } 00029 }; 00030 00031 #endif // __WVLOCKDEV_H

Generated on Tue Oct 5 01:09:20 2004 for WvStreams by doxygen 1.3.7