1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
6 * Created on: Apr 28, 2014
10 #include <Events_Error.h>
11 #include <Events_Loop.h>
13 #define THROW_EMPTY_AIS_EXCEPTION
15 Events_Error::Events_Error(const std::string& theDescription, const void* theSender)
16 : Events_Message(Events_Error::errorID(), theSender)
18 myDescription = theDescription;
21 Events_Error::~Events_Error()
25 Events_ID Events_Error::errorID()
27 Events_Loop* aLoop = Events_Loop::loop();
28 return aLoop->eventByName("ApplicationError");
31 const char* Events_Error::description() const
33 return myDescription.c_str();
36 void Events_Error::send(const std::string& theDescription, const void* theSender)
38 std::shared_ptr<Events_Message> aNewOne =
39 std::shared_ptr<Events_Message>(new Events_Error(theDescription, theSender));
40 Events_Loop::loop()->send(aNewOne);
43 void Events_Error::throwException(const std::string& theDescription)
45 #ifdef THROW_EMPTY_AIS_EXCEPTION
51 std::string("An exception: ") + theDescription);