comparison enigma/enigma_types.h @ 0:74ebb2150658

Initial commit. Working on the rotor class.
author Brian Neal <bgneal@gmail.com>
date Thu, 21 Jun 2012 21:05:26 -0500
parents
children 1459e74fda3f
comparison
equal deleted inserted replaced
-1:000000000000 0:74ebb2150658
1 #ifndef CPP_ENIGMA_ENIGMA_TYPES_H
2 #define CPP_ENIGMA_ENIGMA_TYPES_H
3 // Copyright (C) 2012 by Brian Neal.
4 // This file is part of Cpp-Enigma, the Enigma Machine simulation.
5 // Cpp-Enigma is released under the MIT License (see License.txt).
6 //
7 // enigma_types.h - This file contains common types used throughout Cpp-Enigma.
8
9 #include <exception>
10 #include <string>
11
12 namespace enigma
13 {
14 class enigma_error : public std::exception
15 {
16 public:
17 explicit enigma_error(const std::string& what_arg)
18 : what_arg(what_arg)
19 {}
20
21 virtual ~enigma_error() throw() {}
22
23 virtual const char* what() const throw()
24 {
25 return what_arg.c_str();
26 }
27
28 private:
29 std::string what_arg;
30 };
31 }
32
33 #endif