IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ProcessingResult.h
1 // ProcessingResult.h:
3 // -------------------
4 //
15 
16 #ifndef __IPSDKUTIL_PROCESSINGRESULT_H__
17 #define __IPSDKUTIL_PROCESSINGRESULT_H__
18 
19 #include <string>
21 
22 namespace ipsdk {
23 
26 
27 template <class T>
29 {
30 public:
33 
36 
38  ProcessingResult(const T& result, const std::string& msg = "") :
39  _result(result), _msg(msg) {}
40 
42  ProcessingResult(const ProcessingResult& processingResult) :
43  _result(processingResult._result), _msg(processingResult._msg) {}
44 
46  ProcessingResult& operator=(const ProcessingResult& processingResult) {
47  _result = processingResult._result;
48  _msg = processingResult._msg;
49  return *this;
50  }
51 
55 
56 // methods
57 public:
60  const T& getResult() const {return _result;}
61  void setResult(const T& result) {_result = result;}
63 
66  const std::string& getMsg() const {return _msg;}
67  void setMsg(const std::string& msg) {_msg = msg;}
69 
71  operator const T&() const {return _result;}
72 
73 // attributes
74 protected:
77 
79  std::string _msg;
80 };
81 
84 
85 } // end of namespace ipsdk
86 
87 #endif // __IPSDKUTIL_PROCESSINGRESULT_H__
Class allowing to encapsulate a typed process result associated to a string description.
Definition: ProcessingResult.h:28
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void setMsg(const std::string &msg)
access to string associated to object
Definition: ProcessingResult.h:67
const std::string & getMsg() const
access to string associated to object
Definition: ProcessingResult.h:66
void setResult(const T &result)
access to result associated to object
Definition: ProcessingResult.h:61
T _result
result associated to object
Definition: ProcessingResult.h:76
ProcessingResult & operator=(const ProcessingResult &processingResult)
copy operator
Definition: ProcessingResult.h:46
ProcessingResult(const ProcessingResult &processingResult)
copy constructor
Definition: ProcessingResult.h:42
ProcessingResult()
default constructor
Definition: ProcessingResult.h:35
std::string _msg
string associated to object
Definition: ProcessingResult.h:79
const T & getResult() const
access to result associated to object
Definition: ProcessingResult.h:60
~ProcessingResult()
destructor
Definition: ProcessingResult.h:53
Predefined types for processing results management.
ProcessingResult(const T &result, const std::string &msg="")
constructor with result value and optional associated message
Definition: ProcessingResult.h:38