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
17namespace gbxserialacfr {
18namespace lockfile {
19
23class LockFileException : public std::exception
24{
25 std::string message_;
26public:
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
36class LockedByOtherProcessException : public LockFileException
37{
38public:
39 LockedByOtherProcessException( const std::string &message )
40 : LockFileException(message) {}
41 ~LockedByOtherProcessException()throw(){}
42};
43
57class LockFile {
58public:
59
60 LockFile( const std::string &dev,
61 int lockPid = getpid() );
62 ~LockFile();
63
64private:
65
66 const std::string dev_;
67 const int lockPid_;
68
69};
70
71}
72}
73#endif
Simple serial port interface.
Definition gbxnovatelacfr/driver.h:21
 

Generated for GearBox by  doxygen 1.4.5