1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Events_InfoMessage.hxx
4 // Created: 31 May 2016
5 // Author: Vitaly SMETANNIKOV
7 #ifndef Events_InfoMessage_H_
8 #define Events_InfoMessage_H_
11 #include <Events_Message.h>
12 #include <Events_Loop.h>
14 class EVENTS_EXPORT Events_InfoMessage: public Events_Message
17 Events_InfoMessage(const void* theSender = 0) :
18 Events_Message(Events_Loop::eventByName("InfoMessage"), theSender) {}
20 void setContext(const std::string& theContext) { myContext = theContext; }
22 std::string context() const { return myContext; }
24 void setMessage(const std::string& theMsg) { myMessage = theMsg; }
26 std::string message() const { return myMessage; }
28 void addParameter(const std::string& theParam)
30 myParameters.push_back(theParam);
33 void addParameter(double theParam)
36 int n = sprintf(aBuf, "%g", theParam);
37 std::string aStr(aBuf);
38 myParameters.push_back(aStr);
41 void addParameter(int theParam)
44 int n = sprintf(aBuf, "%d", theParam);
45 std::string aStr(aBuf);
46 myParameters.push_back(aStr);
49 std::list<std::string> parameters() const { return myParameters; }
53 /// Context of the messgae
54 std::string myContext;
56 /// String of the message
57 std::string myMessage;
59 /// Parameters of the message
60 std::list<std::string> myParameters;