Salome HOME
Replace char* myDescription to std::string myDescription in Events_Error
[modules/shaper.git] / src / Events / Events_Error.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * Events_Error.cpp
5  *
6  *  Created on: Apr 28, 2014
7  *      Author: sbh
8  */
9
10 #include <Events_Error.h>
11 #include <Events_Loop.h>
12
13 Events_Error::Events_Error(const std::string& theDescription, const void* theSender)
14     : Events_Message(Events_Error::errorID(), theSender)
15 {
16   myDescription = theDescription;
17 }
18
19 Events_Error::~Events_Error()
20 {
21 }
22
23 Events_ID Events_Error::errorID()
24 {
25   Events_Loop* aLoop = Events_Loop::loop();
26   return aLoop->eventByName("ApplicationError");
27 }
28
29 const char* Events_Error::description() const
30 {
31   return myDescription.c_str();
32 }
33
34 void Events_Error::send(const std::string& theDescription, const void* theSender)
35 {
36   std::shared_ptr<Events_Message> aNewOne = 
37     std::shared_ptr<Events_Message>(new Events_Error(theDescription, theSender));
38   Events_Loop::loop()->send(aNewOne);
39 }