Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5231: Add NotificationMessage type to be sent to the UI. Start refac…
…toring the selection::algorithm::Primitives file.
- Loading branch information
1 parent
0589d2c
commit c118ba4
Showing
6 changed files
with
89 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include "imessagebus.h" | ||
#include "iradiant.h" | ||
|
||
namespace radiant | ||
{ | ||
|
||
/** | ||
* Message object sent to the MessageBus to notify about something. | ||
*/ | ||
class NotificationMessage : | ||
public IMessage | ||
{ | ||
private: | ||
std::string _message; | ||
public: | ||
NotificationMessage(const std::string& message) : | ||
_message(message) | ||
{} | ||
|
||
const std::string& getMessage() const | ||
{ | ||
return _message; | ||
} | ||
|
||
// Convenience method, creating an instance and dispatching it to the message bus | ||
static void Send(const std::string& message) | ||
{ | ||
NotificationMessage msg(message); | ||
GlobalRadiantCore().getMessageBus().sendMessage(msg); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters