WvStreams
wvlockdev.h
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 
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