MTemplateError.h
1 /*****************************************************************************
2 **
3 ** Header file for Virtual Vertex Template error class
4 **
5 ** Name : MTemplateError.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 MTEMPLATE_ERROR_H
19 #define MTEMPLATE_ERROR_H
20 
21 #ifdef WIN32
22 // Windows definitions
23 #ifdef MTEMPLATE_EXPORTS
24 #define MTEMPLATE_API __declspec(dllexport)
25 #else
26 #define MTEMPLATE_API __declspec(dllimport)
27 #endif
28 #else
29 
30 #ifndef MTEMPLATE_EXPORTS
31 #ifdef LINUX
32 #define MTEMPLATE_API
33 #else
34 #define MTEMPLATE_API
35 #endif
36 #else
37 #define MTEMPLATE_API
38 #endif
39 #endif
40 
41 // Disable STL Export warning
42 #if defined(_WIN32)
43 #pragma warning(disable: 4251)
44 #endif // _WIN32
45 
46 #include <string>
47 
48 namespace MTemplateEngine {
60  class MTEMPLATE_API MTemplateError {
61 
62  public:
66  kTemplateErrorDefault = 0x01,
67  kTemplateErrorPauseJob = 0x02,
68  kTemplateErrorPauseClient = 0x04,
69  kTemplateErrorAddTemplateToExclusion = 0x08,
70  kTemplateErrorAddJobToExclusion = 0x10,
71  kTemplateErrorRequeueChunk = 0x20,
72  kTemplateErrorAbortRender = 0x40,
73  kTemplateErrorIncreaseRequeue = 0x80,
74  kTemplateErrorKillAnyInstance = 0x100
75  };
76 
87  kTemplateErrorReservTerminationError
88  };
89 
91  MTemplateError(int errorCode, std::string errorString, int _errorType);
92  MTemplateError & operator=(const MTemplateError & rhs);
93  ~MTemplateError();
94 
95  int getErrorCode();
96  void setErrorCode(int _errorCode);
97  std::string getErrorString();
98  void setErrorString(const std::string& _errorString);
99  void addErrorAction(int _errorAction);
100  void setErrorActionToDefault();
101  int getErrorAction();
102  void setErrorType(int _errorType);
103  int getErrorType();
104  private:
105  int errorCode;
106  std::string errorString;
107  int errorAction;
108  int errorType;
109  };
110 
112 };
113 
114 #endif
Class holding a template API error object.