MeVisLab Toolbox Reference
mlFilterMessage.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
6 
11 //----------------------------------------------------------------------------------
12 
13 #pragma once
14 
15 #include "MLFileListToolsSystem.h"
16 #include <mlModuleIncludes.h>
17 
18 #include <list>
19 
20 ML_START_NAMESPACE
21 
25 
26 public:
29  std::string fileP = "",
30  int lineNumberP = 0,
31  std::string functionP = "",
32  MLErrorCode errorCodeP = ML_RESULT_OK,
33  std::string handlingP = "");
34 
36  std::string dumpToString() const;
37 
40 
42  std::string file;
43 
46 
49 
51  std::string function;
52 
54  std::string handling;
55 };
56 
58 typedef std::list< FilterMessage > FilterMessageList;
59 
61 std::string dumpFilterMessageList(const FilterMessageList& msgList);
62 
63 //----------------------------------------------------------------------------------
74 //----------------------------------------------------------------------------------
75 #define _SEND_FILTER_MESSAGE(MESSAGE_PRINT_MACRO, MESSAGE_LIST, MESSAGE_TYPE, FILE, LINE, FUNCTION, ERROR_CODE, HANDLING) \
76  if (MESSAGE_LIST){ \
77  FilterMessage message(MESSAGE_TYPE, FILE, LINE, FUNCTION, ERROR_CODE, HANDLING); \
78  messageList->push_back(message); \
79  } \
80  else{ \
81  MESSAGE_PRINT_MACRO(FUNCTION, ERROR_CODE, HANDLING); \
82  }
83 
84 ML_END_NAMESPACE
Project global and OS specific declarations.
Helper class to store and handle error messages occuring in filter calls as well as to convert them t...
MLErrorCode errorCode
The ML error code of the message.
MLMessageType messageType
The ML error type of the message.
std::string handling
Description and/or what will be done to handle it.
FilterMessage(MLMessageType messageTypeP=ML_INFORMATION, std::string fileP="", int lineNumberP=0, std::string functionP="", MLErrorCode errorCodeP=ML_RESULT_OK, std::string handlingP="")
Convenience initialization of the FilterMessage.
std::string file
The file in which the message occurred.
std::string dumpToString() const
Converts the error information to a human readable string.
int lineNumber
The line in file where the message occurred.
MLint32 MLErrorCode
Type of an ML Error code.
Definition: mlTypeDefs.h:818
#define ML_RESULT_OK
No error. Everything seems to be okay.
Definition: mlTypeDefs.h:826
MLMessageType
Message types handled by the ErrorOutput class.
Definition: mlTypeDefs.h:798
@ ML_INFORMATION
Definition: mlTypeDefs.h:804
std::string dumpFilterMessageList(const FilterMessageList &msgList)
Convenience function which dumps an entire list of filter messages into one string.
std::list< FilterMessage > FilterMessageList
List of messages which can occur during filter calls.