Muster SDK  8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MError.h
Go to the documentation of this file.
1 /*****************************************************************************
2  **
3  ** Header file for Muster API Error object
4  **
5  ** Name : MError.h
6  ** Author : Leonardo Bernardini
7  ** Version : 1.0, Sat Mar 2nd 2013
8  **
9  ** Copyright 2000-2014, 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 
69  public:
70  MUSTERERR(const std::string& _description, int _errorCode);
71  MUSTERERR(int _errorCode);
72  std::string getDescription();
73  int getErrorCode() ;
74  std::string toString();
75  private:
76  std::string description;
77  int errorCode;
78  } ;
79 
80 }
81 
82 #endif