Teamcenter C++ API Reference  2312
IFail.hxx
Go to the documentation of this file.
1 // Copyright 2022 Siemens Digital Industries Software
2 // ==================================================
3 // Copyright 2013.
4 // Siemens Product Lifecycle Management Software Inc.
5 // All Rights Reserved.
6 // ==================================================
7 // Copyright 2022 Siemens Digital Industries Software
8 
17 #ifndef TEAMCENTER_BASE_UTILS_IFAIL_HXX
18 #define TEAMCENTER_BASE_UTILS_IFAIL_HXX
19 
20 #include <vector>
21 #include <string>
22 #include <ostream>
23 
24 #include <base_utils/libbase_utils_exports.h>
25 
26 class ResultStatus;
27 class ResultCheck;
28 
49 class BASE_UTILS_API IFail
50 {
51 public:
56  IFail();
57 
70  IFail( int ifail,
71  const char *s1=0, const char *s2=0, const char *s3=0,
72  const char *s4=0, const char *s5=0, const char *s6=0,
73  const char *s7=0 ); /* */
74 
78  IFail( int ifail, const std::string& s1 );
79  IFail( int ifail, const std::string& s1, const std::string& s2 );
80 
84  ~IFail();
85 
89  int ifail() const;
90 
94  operator int() const; /* */
95 
105  void getAndClearErrorStack( std::vector<int>& errorCodes,
106  std::vector<int>& severities,
107  std::vector<std::string>& errorMessages );
108 
112  const std::string & getMessage() const;
113 
114 private:
116  IFail( bool storeError, int ifail );
117 
119  int m_ifail;
120  std::string m_message;
121 
122  friend class ResultStatus;
123  friend class ResultCheck;
124 };
125 
138 BASE_UTILS_API std::ostream& operator<<( std::ostream& out, const IFail& ifail );
139 
140 #include <base_utils/libbase_utils_undef.h>
141 
142 #endif