~ubuntu-branches/ubuntu/maverick/gpsdrive/maverick

« back to all changes in this revision

Viewing changes to src/garmin_error.h

  • Committer: Bazaar Package Importer
  • Author(s): Frank Kirschner
  • Date: 2004-05-25 11:44:03 UTC
  • Revision ID: james.westby@ubuntu.com-20040525114403-j3rsu57cavfax6z8
Tags: upstream-2.09
ImportĀ upstreamĀ versionĀ 2.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// $Id: garmin_error.h,v 1.2 2003/04/28 15:10:03 ganter Exp $
 
2
// garmin_error.h
 
3
// Douglas S. J. De Couto
 
4
// September 9, 1998
 
5
 
 
6
// Copyright (C) 1998 Douglas S. J. De Couto
 
7
// <decouto@lcs.mit.edu>
 
8
//
 
9
// This program is free software; you can redistribute it and/or
 
10
// modify it under the terms of the GNU General Public License
 
11
// as published by the Free Software Foundation; either version 2
 
12
// of the License, or (at your option) any later version.
 
13
//
 
14
// This program is distributed in the hope that it will be useful,
 
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
// GNU General Public License for more details.
 
18
 
 
19
#ifndef _garerrh
 
20
#define _garerrh
 
21
 
 
22
#include <string>
 
23
 
 
24
namespace garmin {
 
25
 
 
26
class error 
 
27
{
 
28
public:
 
29
        error() : m_msg("<no msg>") { }
 
30
        error(const error &err) : m_msg(err.m_msg) { }
 
31
        error(const std::string &msg) : m_msg(msg) { }
 
32
        
 
33
        std::string m_msg;
 
34
};
 
35
 
 
36
class not_possible : public error 
 
37
{
 
38
public:
 
39
        not_possible() : error("The operation was not possible") { }
 
40
        not_possible(const not_possible &err) : error(err) { }
 
41
        not_possible(const std::string &msg) : error(msg) { }
 
42
};
 
43
 
 
44
class timeout : public error 
 
45
{
 
46
public:
 
47
        timeout() : error("The operation timed out") { }
 
48
        timeout(const timeout &err) : error(err) { }
 
49
        timeout(const std::string &msg) : error(msg) { }
 
50
};
 
51
 
 
52
class bad_time : public error 
 
53
{
 
54
public:
 
55
        bad_time() : error("The supplied time value is invalid") { }
 
56
        bad_time(const bad_time &err) : error(err) { }
 
57
        bad_time(const std::string &msg) : error(msg) { }
 
58
};
 
59
 
 
60
 
 
61
class unsupported_protocol : public error 
 
62
{
 
63
public:
 
64
        unsupported_protocol() : error("The selected protocol is not supported") { }
 
65
        unsupported_protocol(const unsupported_protocol &err) : error(err) { }
 
66
        unsupported_protocol(const std::string &msg) : error(msg) { }
 
67
};
 
68
 
 
69
class unsupported_datatype : public error 
 
70
{
 
71
public:
 
72
        unsupported_datatype() : error("The required datatype is not supported") { }
 
73
        unsupported_datatype(const unsupported_protocol &err) : error(err) { }
 
74
        unsupported_datatype(const std::string &msg) : error(msg) { }
 
75
};
 
76
} // namespace
 
77
 
 
78
#endif // _garerrh