XTA: API Reference for C++ language

Exception.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2018, Christian Ferrari <tiian@users.sourceforge.net>
3  * All rights reserved.
4  *
5  * This file is part of LIXA.
6  *
7  * LIXA is free software: you can redistribute this file and/or modify
8  * it under the terms of the GNU Lesser General Public License version 2.1 as
9  * published by the Free Software Foundation.
10  *
11  * LIXA is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with LIXA. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef EXCEPTION_HPP
20 # define EXCEPTION_HPP
21 
22 
23 
24 /* include C++ standard header files */
25 #include <stdexcept>
26 #include <string>
27 
28 /* include XTA header file */
29 #include "xta.h"
30 
31 
32 
33 using namespace std;
34 
35 
36 
37 namespace xta {
38 
47  class Exception : public runtime_error {
48  private:
56  string Function;
57 
58  public:
64  Exception(int ret_cod, const string& function) :
65  runtime_error(lixa_strerror(ret_cod)) {
66  ReturnCode = ret_cod;
67  Function = function;
68  }
69  ~Exception() throw() {;}
70  const string& where() { return Function; }
75  int getReturnCode() { return ReturnCode; }
82  string getReturnCodeText() {
83  return (string(lixa_strerror(ReturnCode))); }
84  };
85 
86 };
87 
88 
89 
90 #endif /* EXCEPTION_HPP */
string getReturnCodeText()
Definition: Exception.hpp:82
string Function
Definition: Exception.hpp:56
Exception(int ret_cod, const string &function)
Definition: Exception.hpp:64
const string & where()
Definition: Exception.hpp:70
int getReturnCode()
Definition: Exception.hpp:75

Copyright © 2009-2019, Christian Ferrari tiian@users.sourceforge.net http://www.tiian.org/