• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

  • kdecore
klockfile.h
1 /*
2  This file is part of the KDE libraries
3  Copyright (c) 2004 Waldo Bastian <bastian@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef _KLOCKFILE_H_
21 #define _KLOCKFILE_H_
22 
23 #include <tqstring.h>
24 #include <tqdatetime.h>
25 
26 #include <ksharedptr.h>
33 class KDECORE_EXPORT KLockFile : public KShared
34 {
35 public:
36  typedef KSharedPtr<KLockFile> Ptr;
37 
38  KLockFile(const TQString &file);
39 
43  ~KLockFile();
44 
48  enum LockResult {
52  LockOK = 0,
53 
57  LockFail,
58 
62  LockError,
63 
67  LockStale
68  };
69 
70  enum LockOptions {
74  LockNoBlock = 1,
75 
80  LockForce = 2
81  };
82 
88  LockResult lock(int options=0);
89 
93  bool isLocked() const;
94 
98  void unlock();
99 
104  int staleTime() const;
105 
109  void setStaleTime(int _staleTime);
110 
116  bool getLockInfo(int &pid, TQString &hostname, TQString &appname);
117 
118 private:
119  class KLockFilePrivate;
120  KLockFilePrivate *d;
121 };
122 
123 #endif
KLockFile::LockError
The lock could not be acquired due to an error.
Definition: klockfile.h:62
KSharedPtr< KLockFile >
KLockFile::LockResult
LockResult
Possible return values of the lock function.
Definition: klockfile.h:48
KLockFile::LockFail
The lock could not be acquired because it is held by another process.
Definition: klockfile.h:57
KLockFile
The KLockFile class provides NFS safe lockfiles.
Definition: klockfile.h:33
KLockFile::LockOptions
LockOptions
Definition: klockfile.h:70
KShared
Reference counting for shared objects.
Definition: ksharedptr.h:40

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |