MError.h
1 /*****************************************************************************
2  **
3  ** Header file for Muster API Error object
4  **
5  ** Name : MError.h
6  ** Author : Leonardo Bernardini
7 ** Version : Alpha 9.0 Wed May 17th 2017
8  **
9  ** Copyright 2000-2017, Virtual Vertex
10  ** All Rights Reserved.
11  **
12  ** This file contains UNPUBLISHED PROPRIETARY SOURCE CODE.
13  ** The contents of this file may not be disclosed to third parties, copied
14  ** or duplicated in any form, in whole or in part, without the prior written
15  ** permission of the author.
16  **
17  *****************************************************************************/
18 #ifndef MERROR_H
19 #define MERROR_H
20 
21 #include "MClientLib/MErrors.h"
22 
23 #ifdef WIN32
24 
25 // Disable STL Export warning, member is private, we don't need direct access from the DLL client
26 #if defined(_WIN32)
27 #pragma warning(disable: 4251)
28 #endif // _WIN32
29 
30 // Windows definitions
31 #ifdef MCLIENTLIB_EXPORTS
32 #define MCLIENTLIB_API __declspec(dllexport)
33 #else
34 #define MCLIENTLIB_API __declspec(dllimport)
35 #endif
36 #else
37 
38 #ifndef MCLIENTLIB_EXPORTS
39 #ifdef LINUX
40 #define MCLIENTLIB_API
41 #else
42 #define MCLIENTLIB_API
43 #endif
44 #else
45 #define MCLIENTLIB_API
46 #endif
47 
48 #endif
49 
50 #include <string>
51 
52 namespace MClientLib {
53 
54 #ifdef SWIG
55  %extend MUSTERERR {
56  std::string __print__() {
57  return $self->toString();
58  }
59 #if defined(SWIGPYTHON_BUILTIN)
60  %feature("python:slot", "tp_print", functype="printfunc") __print__;
61 #endif
62  }
63 #endif
64 
75  class MCLIENTLIB_API MUSTERERR {
76  public:
77  MUSTERERR();
78  MUSTERERR(const std::string& _description, int _errorCode);
79  MUSTERERR(int _errorCode);
80  std::string getDescription();
81  int getErrorCode() ;
82  std::string toString();
83  private:
84  std::string description;
85  int errorCode;
86  } ;
87 
90 }
91 
92 #endif
Class holding an API error object.
Definition: MError.h:75