INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
lockfile.h
1 /*
2  * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
3  * http://gearbox.sf.net/
4  * Copyright (c) 2004-2010 Alex Brooks
5  *
6  * This distribution is licensed to you under the terms described in
7  * the LICENSE file included in this distribution.
8  *
9  */
10 #ifndef GBXSERIALACFR_LOCKFILE_H
11 #define GBXSERIALACFR_LOCKFILE_H
12 
13 #include <unistd.h>
14 #include <exception>
15 #include <string>
16 
17 namespace gbxserialacfr {
18 namespace lockfile {
19 
23 class LockFileException : public std::exception
24 {
25  std::string message_;
26 public:
27  LockFileException( const std::string &message )
28  : message_(message) {}
29  ~LockFileException()throw(){}
30  virtual const char* what() const throw() { return message_.c_str(); }
31 };
32 
37 {
38 public:
39  LockedByOtherProcessException( const std::string &message )
40  : LockFileException(message) {}
42 };
43 
57 class LockFile {
58 public:
59 
60  LockFile( const std::string &dev,
61  int lockPid = getpid() );
62  ~LockFile();
63 
64 private:
65 
66  const std::string dev_;
67  const int lockPid_;
68 
69 };
70 
71 }
72 }
73 #endif
Exception thrown by lockfile functions.
Definition: lockfile.h:23
Thrown when we try to lock a resource which has been locked by another process.
Definition: lockfile.h:36
Simple serial port interface.
Definition: gbxnovatelacfr/driver.h:21
Definition: lockfile.h:57
 

Generated for GearBox by  doxygen 1.4.5