VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gvexit.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2017 Graeme Walker
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program 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
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
17 ///
18 /// \file gvexit.h
19 ///
20 
21 #ifndef GV_EXIT__H
22 #define GV_EXIT__H
23 
24 #include "gdef.h"
25 
26 namespace Gv
27 {
28  class Exit ;
29 }
30 
31 /// \class Gv::Exit
32 /// A simple exception structure holding a program exit value. This class
33 /// is deliberately not derived from std::exception.
34 ///
35 class Gv::Exit
36 {
37 public:
38  explicit Exit( int exit_value = EXIT_SUCCESS ) ;
39  ///< Constructor.
40 
41  int value() const ;
42  ///< Returns the exit value, as given to the ctor.
43 
44 private:
45  int m_value ;
46 } ;
47 
48 inline
49 Gv::Exit::Exit( int value ) :
50  m_value(value)
51 {
52 }
53 
54 inline
55 int Gv::Exit::value() const
56 {
57  return m_value ;
58 }
59 
60 #endif
int value() const
Returns the exit value, as given to the ctor.
Definition: gvexit.h:55
Exit(int exit_value=EXIT_SUCCESS)
Constructor.
Definition: gvexit.h:49
A simple exception structure holding a program exit value.
Definition: gvexit.h:35