Salome HOME
[Code coverage]: Move checking the algorithm's result into separate function
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Tools.h
index f17efdc3b735b1040812bb1872adab95d602ebb2..bb0c28f2b3faf961a3b6ab1a97826f7a46b9e385 100644 (file)
 
 #include <GeomAlgoAPI.h>
 
+#include <memory>
 #include <string>
 
+class GeomAlgoAPI_MakeShape;
+
 namespace GeomAlgoAPI_Tools {
 
 /** \class Localizer
@@ -56,6 +59,24 @@ public:
   GEOMALGOAPI_EXPORT static std::string name(const std::string& theFileName);
 };
 
+/** \class AlgoError
+ *  \ingroup DataAlgo
+ *  \brief Verify error in MakeShape algorithm.
+ */
+class AlgoError {
+public:
+  /** \brief Verify MakeShape algorithm for failures
+   *  \param[in]  theAlgorithm object to verify the failure
+   *  \param[in]  theFeature   kind of the feature, the algorithm belongs to
+   *  \param[out] theError     error string (empty if the feature succeed)
+   *  \return \c true if succeed
+   */
+  GEOMALGOAPI_EXPORT static bool isAlgorithmFailed(
+      const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm,
+      const std::string& theFeature,
+      std::string& theError);
+};
+
 } // GeomAlgoAPI_Tools
 
 #endif /* GEOMALGOAPI_TOOLS_H_ */