Salome HOME
Issue #1664 In the Sketcher, add the function Split a segment - correction for arc...
[modules/shaper.git] / src / Events / Events_InfoMessage.h
index 556c1db27858dea971f63d00dee14a352e7776ad..2924df181116796ad571560ac69f6508577cbdeb 100644 (file)
@@ -24,7 +24,7 @@ public:
 
   /// Constructor
   /// \param theSender a pointer on sender object
-  Events_InfoMessage(const void* theSender = 0):Events_Message(Events_Loop::eventByName("InfoMessage"), theSender) {}
+  explicit Events_InfoMessage(const void* theSender = 0):Events_Message(Events_Loop::eventByName("InfoMessage"), theSender) {}
 
   /// Constructor
   /// \param theSender a pointer on sender object
@@ -54,6 +54,15 @@ public:
   /// Returns message
   std::string messageString() const { return myMessage; }
 
+  Events_InfoMessage& operator=(const std::string& theMsg) {
+    setMessageString(theMsg);
+    return *this;
+  }
+
+  bool empty() const {
+    return myMessage.empty();
+  }
+
   /// Add parameter for message string of string type
   /// \param theParam the parameter
   void addParameter(const std::string& theParam) 
@@ -63,23 +72,11 @@ public:
 
   /// Add parameter for message string of double type
   /// \param theParam the parameter
-  void addParameter(double theParam) 
-  { 
-    char aBuf[50];
-    int n = sprintf(aBuf, "%g", theParam);
-    std::string aStr(aBuf);
-    myParameters.push_back(aStr); 
-  }
+  EVENTS_EXPORT void addParameter(double theParam);
 
   /// Add parameter for message string of integer type
   /// \param theParam the parameter
-  void addParameter(int theParam) 
-  { 
-    char aBuf[50];
-    int n = sprintf(aBuf, "%d", theParam);
-    std::string aStr(aBuf);
-    myParameters.push_back(aStr); 
-  }
+  EVENTS_EXPORT void addParameter(int theParam);
 
   /// Returns list of parameters
   std::list<std::string> parameters() const { return myParameters; }
@@ -96,10 +93,8 @@ public:
   /// \param theParam the parameter
   Events_InfoMessage& arg(double theParam) { addParameter(theParam); return *this; }
 
-  void send() { 
-    std::shared_ptr<Events_Message> aMsg(new Events_InfoMessage(*this));
-    Events_Loop::loop()->send(aMsg); 
-  }
+  /// Send the message
+  EVENTS_EXPORT void send();
 
 private:
 
@@ -113,4 +108,4 @@ private:
   std::list<std::string> myParameters;
 };
 
-#endif
\ No newline at end of file
+#endif