]> Creatis software - cpPlugins.git/blobdiff - lib/third_party/Pluma/Host.cpp
Parameters are now part of the pipeline update process
[cpPlugins.git] / lib / third_party / Pluma / Host.cpp
index eb37c33195eb45e98613d3fb9963f39b4ee3fe86..6fb5539b89dea0555c7a9988f46e7e4c74555f33 100644 (file)
@@ -28,6 +28,7 @@
 ////////////////////////////////////////////////////////////\r
 #include <Pluma/Host.hpp>\r
 #include <cstdio>\r
+#include <stdexcept>\r
 \r
 \r
 namespace pluma{\r
@@ -41,7 +42,8 @@ Host::Host(){
 ////////////////////////////////////////////////////////////\r
 bool Host::add(Provider* provider){\r
     if (provider == NULL){\r
-        fprintf(stderr, "Trying to add a null provider.\n");\r
+      //fprintf(stderr, "Trying to add a null provider.\n");\r
+      throw std::runtime_error( "Trying to add a null provider." );\r
         return false;\r
     }\r
     if (!validateProvider(provider)){\r
@@ -122,11 +124,19 @@ const std::list<Provider*>* Host::getProviders(const std::string& type) const{
 bool Host::validateProvider(Provider* provider) const{\r
     const std::string& type = provider->plumaGetType();\r
     if ( !knows(type) ){\r
-        fprintf(stderr, "%s provider type isn't registered.\n", type.c_str());\r
+      // fprintf(stderr, "%s provider type isn't registered.\n", type.c_str());\r
+      throw std::runtime_error(\r
+        type + std::string( " provider type isn't registered." )\r
+        );\r
         return false;\r
     }\r
     if (!provider->isCompatible(*this)){\r
-        fprintf(stderr, "Incompatible %s provider version.\n", type.c_str());\r
+      // fprintf(stderr, "Incompatible %s provider version.\n", type.c_str());\r
+      throw std::runtime_error(\r
+        std::string( "Incompatible " ) +\r
+        type +\r
+        std::string( " provider version." )\r
+        );\r
         return false;\r
     }\r
     return true;\r