Changeset 8445 for code/branches/tutoriallevel2/src
- Timestamp:
- May 10, 2011, 11:37:22 PM (14 years ago)
- Location:
- code/branches/tutoriallevel2/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutoriallevel2/src/modules/notifications/Notification.cc
r8374 r8445 48 48 The sender of the Notification. 49 49 */ 50 Notification::Notification(const std::string& message, const std::string& sender )50 Notification::Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type) 51 51 { 52 52 RegisterRootObject(Notification); … … 54 54 this->message_ = message; 55 55 this->sender_ = sender; 56 this->type_ = type; 56 57 } 57 58 -
code/branches/tutoriallevel2/src/modules/notifications/Notification.h
r8374 r8445 40 40 #include <string> 41 41 #include "core/OrxonoxClass.h" 42 #include "interfaces/NotificationListener.h" 42 43 43 44 namespace orxonox … … 48 49 A Notification represents a short message used to inform the player about something that just happened. With the @ref orxonox::NotificationManager "NotificationManager" a Notification can be sent from any part of orxonox and is then displayed by the proper @ref orxonox::NotificationQueue "NotificationQueue(s)" (depending on which senders the specific @ref orxonox::NotificationQueue "NotificationQueues" accepts). 49 50 50 A Notification is just a data structure that is used internally by the Notifications module.51 A Notification is just a data structure that is used internally by the Notifications module. 51 52 52 53 @author … … 58 59 { 59 60 public: 60 Notification(const std::string& message, const std::string& sender );61 Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type); 61 62 virtual ~Notification(); 62 63 … … 75 76 { return this->sender_; } 76 77 78 /** 79 @brief Get the type of the Notification. 80 @return Returns an enum with the type of the Notification. 81 */ 82 inline notificationMessageType::Value getType(void) const 83 { return this->type_; } 84 77 85 private: 78 86 std::string message_; //!< The Notification message. 79 87 std::string sender_; //!< The sender of the notification. 88 notificationMessageType::Value type_; //!< The type of the notification. 80 89 81 90 void initialize(void); //!< Registers the object and sets some default values. -
code/branches/tutoriallevel2/src/modules/notifications/NotificationDispatcher.cc
r8377 r8445 113 113 { 114 114 const std::string message = this->createNotificationMessage(); 115 NotificationListener::sendNotification(message, this->getSender(), notificationMessageMode::message, notificationSendMode::network, clientId); 115 // TODO: Make the type configurable. 116 NotificationListener::sendNotification(message, this->getSender(), notificationMessageType::info, notificationSendMode::network, clientId); 116 117 } 117 118 else if(GameMode::isServer()) -
code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.cc
r8378 r8445 105 105 this->queues_.clear(); 106 106 } 107 108 /** 109 @brief 110 Creates and registers a Notification with the input message from the input sender. 111 This is called by the NotificationListener, whenever a new notification arrives. 112 @param message 113 The message of the new Notification. 114 @param sender 115 The name of the entity (of the collective) that sent the new Notification. 116 @return 117 Returns true if successful. 118 */ 119 bool NotificationManager::registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type) 120 { 121 // TODO: Do something with the type. 122 Notification* notification = new Notification(message, sender, type); 123 return this->registerNotification(notification); 124 } 125 126 /** 127 @brief 128 Executes the input command from the input sender. 129 This is called by the NotificationListener, whenever a new command arrives. 130 @param command 131 The command to be executed, 132 @param sender 133 The The name of the entity (of the collective) that sent the command. 134 */ 135 bool NotificationManager::executeCommand(notificationCommand::Value command, const std::string& sender) 136 { 137 if(command == notificationCommand::clear) 138 { 139 this->commandClear(sender); 140 return true; 141 } 142 143 return false; 144 } 145 146 /** 147 @brief 148 The clear command. Clears all NotificationQueues that have its sender as a target. 149 @param sender 150 The sender of the clear command. 151 */ 152 void NotificationManager::commandClear(const std::string& sender) 153 { 154 bool all = (sender == NotificationListener::ALL); 155 // Clear all NotificationQueues that have the input sender as target. 156 for(std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); it++) // Iterate through all NotificationQueues. 157 { 158 const std::set<std::string>& set = it->second->getTargetsSet(); 159 // If either the sender is 'all', the NotificationQueue has as target all or the NotificationQueue has the input sender as a target. 160 if(all || set.find(NotificationListener::ALL) != set.end() || set.find(sender) != set.end()) 161 it->second->tidy(); 162 } 163 } 107 164 108 bool NotificationManager::registerNotification(const std::string& message, const std::string& sender)109 {110 Notification* notification = new Notification(message, sender);111 return this->registerNotification(notification);112 }113 114 165 /** 115 166 @brief … … 132 183 return true; 133 184 134 bool all = false; 135 if(notification->getSender() == NotificationListener::ALL) // If all are the sender, then the Notifications is added to every NotificationQueue. 136 all = true; 185 // If all are the sender, then the Notifications is added to every NotificationQueue. 186 bool all = (notification->getSender() == NotificationListener::ALL); 137 187 138 188 // Insert the Notification in all NotificationQueues that have its sender as target. … … 364 414 365 415 NotificationQueue* infoQueue = new NotificationQueue("info", NotificationListener::ALL, 1, -1); 366 GUIManager::getInstance().getLuaState()->doString("NotificationLayer.changeQueueFont(\"info\", 24, \" FFFFFF00\")");416 GUIManager::getInstance().getLuaState()->doString("NotificationLayer.changeQueueFont(\"info\", 24, \"CCFFFF00\")"); 367 417 GUIManager::getInstance().getLuaState()->doString("NotificationLayer.resizeQueue(\"info\", 0.6, 0, " + multi_cast<std::string>(infoQueue->getMaxSize()) + ")"); 368 418 GUIManager::getInstance().getLuaState()->doString("NotificationLayer.moveQueue(\"info\", 0.2, 0, 0.8, 0)"); -
code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.h
r8374 r8445 67 67 virtual ~NotificationManager(); 68 68 69 virtual void preDestroy(void); // !<Is called before the object is destroyed.69 virtual void preDestroy(void); // Is called before the object is destroyed. 70 70 71 71 /** … … 75 75 static NotificationManager& getInstance() { return Singleton<NotificationManager>::getInstance(); } // tolua_export 76 76 77 virtual bool registerNotification(const std::string& message, const std::string& sender); 77 virtual bool registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type); 78 virtual bool executeCommand(notificationCommand::Value command, const std::string& sender); 78 79 79 bool registerNotification(Notification* notification); // !<Registers a Notification within the NotificationManager.80 void unregisterNotification(Notification* notification, NotificationQueue* queue); // !<Unregisters a Notification within the NotificationManager for a given NotificationQueue.80 bool registerNotification(Notification* notification); // Registers a Notification within the NotificationManager. 81 void unregisterNotification(Notification* notification, NotificationQueue* queue); // Unregisters a Notification within the NotificationManager for a given NotificationQueue. 81 82 82 void getNotifications(NotificationQueue* queue, std::multimap<std::time_t, Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); // !<Fetches the Notifications for a specific NotificationQueue in a specified timeframe and stores them in the input map.83 void getNotifications(NotificationQueue* queue, std::multimap<std::time_t, Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); // Fetches the Notifications for a specific NotificationQueue in a specified timeframe and stores them in the input map. 83 84 84 85 /** 85 @brief Fetches the Notifications for a specific NotificationQueue in a timeframe from now-timeDelayto now and stores them in the input map.86 @param listenerThe NotificationQueue the Notifications are fetched for.86 @brief Fetches the Notifications for a specific NotificationQueue in a timeframe from (now-timeDelay) to now and stores them in the input map. 87 @param queue The NotificationQueue the Notifications are fetched for. 87 88 @param map A pointer to a multimap, in which the notifications are stored. The map needs to have been allocated. 88 89 @param timeDelay The timespan. … … 92 93 { this->getNotifications(queue, map, std::time(0)-timeDelay, std::time(0)); } 93 94 94 void getNewestNotifications(NotificationQueue* queue, std::multimap<std::time_t, Notification*>* map, int numberOfNotifications); // !<Fetches the newest Notifications for a specific NotificationQueue and stores them in the input map.95 void getNewestNotifications(NotificationQueue* queue, std::multimap<std::time_t, Notification*>* map, int numberOfNotifications); // Fetches the newest Notifications for a specific NotificationQueue and stores them in the input map. 95 96 96 void enterEditMode(void); // !<Enters the edit mode of the NotificationLayer.97 void enterEditMode(void); // Enters the edit mode of the NotificationLayer. 97 98 98 bool registerQueue(NotificationQueue* queue); // !<Registers a NotificationQueue.99 void unregisterQueue(NotificationQueue* queue); // !<Unregisters a NotificationQueue.99 bool registerQueue(NotificationQueue* queue); // Registers a NotificationQueue. 100 void unregisterQueue(NotificationQueue* queue); // Unregisters a NotificationQueue. 100 101 101 102 // tolua_begin 102 void loadQueues(void); // !<Loads all the NotificationQueues that should exist.103 void createQueue(const std::string& name); // !<Creates a new NotificationQueue.104 orxonox::NotificationQueue* getQueue(const std::string & name); // !<Get the NotificationQueue with the input name.103 void loadQueues(void); // Loads all the NotificationQueues that should exist. 104 void createQueue(const std::string& name); // Creates a new NotificationQueue. 105 orxonox::NotificationQueue* getQueue(const std::string & name); // Get the NotificationQueue with the input name. 105 106 // tolua_end 106 107 … … 113 114 std::map<const std::string, NotificationQueue*> queues_; //!< The list of NotificationQueues created by the NotificationManager. 114 115 115 bool removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map); //!< Helper method that removes an input Notification form an input map. 116 bool removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map); // Helper method that removes an input Notification form an input map. 117 118 // Commands 119 void commandClear(const std::string& sender); // The clear command. Clears all NotificationQueues that have its sender as a target. 116 120 117 121 }; // tolua_export -
code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc
r8374 r8445 56 56 @param senders 57 57 The senders that are targets of this NotificationQueue, i.e. the names of senders whose Notifications this NotificationQueue displays. 58 The senders need to be sep erated by commas.58 The senders need to be separated by commas. 59 59 @param size 60 60 The size (the maximum number of displayed Notifications) of this NotificationQueue. … … 304 304 Clears the NotificationQueue by removing all NotificationContainers. 305 305 @param noGraphics 306 If this is eset to true the GUI is not informed of the clearing of the NotificationQueue. This is needed only internally.306 If this is set to true the GUI is not informed of the clearing of the NotificationQueue. This is needed only internally. 307 307 */ 308 308 void NotificationQueue::clear(bool noGraphics) … … 369 369 /** 370 370 @brief 371 Produces all targets of the NotificationQueue concat inated as string, with commas (',') as seperators.371 Produces all targets of the NotificationQueue concatenated as string, with commas (',') as separators. 372 372 @return 373 373 Returns the targets as a string. … … 395 395 The targets are the senders whose Notifications are displayed in this queue. 396 396 @param targets 397 Accepts a string of targets, each sep erated by commas (','), spaces are ignored.397 Accepts a string of targets, each separated by commas (','), spaces are ignored. 398 398 */ 399 399 void NotificationQueue::setTargets(const std::string & targets) … … 412 412 } 413 413 } 414 415 void NotificationQueue::tidy(void) 416 { 417 while(this->size_ > 0) 418 this->pop(); 419 } 414 420 415 421 } -
code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.h
r8374 r8445 77 77 Displays @ref orxonox::Notification "Notifications" from specific senders. 78 78 79 There are quite some parameters that influence the behavio ur of the NotificationQueue:79 There are quite some parameters that influence the behavior of the NotificationQueue: 80 80 - @b name The name of the NotificationQueue. It needs to be unique. 81 81 - @b senders The senders that are targets of this NotificationQueue, i.e. the names of senders whose Notifications this NotificationQueue displays. … … 145 145 // tolua_begin 146 146 void setTargets(const std::string & targets); //!< Set the targets of this NotificationQueue. 147 const std::string& getTargets(void) const; //!< Returns a string consisting of the concat ination of the targets.147 const std::string& getTargets(void) const; //!< Returns a string consisting of the concatenation of the targets. 148 148 // tolua_end 149 150 void tidy(void); 149 151 150 152 private: -
code/branches/tutoriallevel2/src/modules/questsystem/QuestDescription.cc
r8377 r8445 119 119 } 120 120 121 NotificationListener::sendNotification(message, QuestDescription::SENDER, notificationMessage Mode::message, notificationSendMode::network, player->getClientID());121 NotificationListener::sendNotification(message, QuestDescription::SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID()); 122 122 return true; 123 123 } -
code/branches/tutoriallevel2/src/orxonox/interfaces/NotificationListener.cc
r8376 r8445 35 35 #include "network/Host.h" 36 36 #include "network/NetworkFunction.h" 37 #include "util/SubString.h" 37 38 38 39 #include "interfaces/NotificationListener.h" … … 41 42 { 42 43 43 const std::string NotificationListener::ALL("all");44 const std::string NotificationListener::NONE("none");44 /*static*/ const std::string NotificationListener::ALL("all"); 45 /*static*/ const std::string NotificationListener::NONE("none"); 45 46 46 registerStaticNetworkFunction(NotificationListener::sendNotificationHelper); 47 // Commands 48 /*static*/ const std::string NotificationListener::COMMAND_CLEAR("clear"); 47 49 50 registerStaticNetworkFunction(NotificationListener::sendHelper); 48 51 49 52 NotificationListener::NotificationListener() … … 54 57 /** 55 58 @brief 56 Sends a Notification with the specified message to the specified client from the specified sender.59 Helper method to send both notifications and commands over the network. 57 60 @param message 58 The message that should be sent.61 The message/command that should be sent. 59 62 @param sender 60 The sender that sent the notification. 61 @param messageMode 62 The mode of the message, can be either 'message' or 'command'. 63 The sender that sent the notification/command. 63 64 @param sendMode 64 The mode in which the notification is sent, can be 'local' to send the notification to the client where this function is executed, 'network' if the notification is to be sent to the client with the specified clientID, or 'broadcast' if the notification should be sent to all hosts.65 The mode in which the notification/command is sent, can be 'local' to send the notification to the client where this function is executed, 'network' if the notification is to be sent to the client with the specified clientID, or 'broadcast' if the notification should be sent to all hosts. 65 66 @param clientId 66 The id of the client the notification should be sent to. 67 The id of the client the notification/command should be sent to. 68 @param isCommand 69 Whether the message is a notification or a command. 70 @param messageType 71 The type of the notification, can be either 'info' or 'important'. 67 72 */ 68 /*static*/ void NotificationListener::sendN otification(const std::string& message, const std::string& sender, notificationMessageMode::Value messageMode, notificationSendMode::Value sendMode, unsigned int clientId)73 /*static*/ void NotificationListener::sendNetworkHelper(const std::string& message, const std::string& sender, notificationSendMode::Value sendMode, unsigned int clientId, bool isCommand, notificationMessageType::Value messageType) 69 74 { 70 // If we're in standalone mode or we're already no the right client we create and send the Notification.75 // If we're in standalone mode or we're already no the right client we create and send the notification/command. 71 76 if(GameMode::isStandalone() || sendMode == notificationSendMode::local || (sendMode == notificationSendMode::network && Host::getPlayerID() == clientId)) 72 77 { 73 send NotificationHelper(message, sender, messageMode);78 sendHelper(message, sender, isCommand, messageType); 74 79 } 75 // If we're on the server (and the server is not the intended recipient of the Notification) we send it over the network.80 // If we're on the server (and the server is not the intended recipient of the notification/command) we send it over the network. 76 81 else if(GameMode::isServer() && sendMode == notificationSendMode::network && Host::getPlayerID() != clientId) 77 82 { 78 callStaticNetworkFunction(NotificationListener::send NotificationHelper, clientId, message, sender, (unsigned int)messageMode);83 callStaticNetworkFunction(NotificationListener::sendHelper, clientId, message, sender, (unsigned int)messageType); 79 84 } 80 85 else if(GameMode::isServer() && sendMode == notificationSendMode::broadcast) 81 86 { 82 87 // TODO: Works as intended? 83 callStaticNetworkFunction(NotificationListener::send NotificationHelper, NETWORK_PEER_ID_BROADCAST, message, sender, (unsigned int)messageMode);88 callStaticNetworkFunction(NotificationListener::sendHelper, NETWORK_PEER_ID_BROADCAST, message, sender, (unsigned int)messageType); 84 89 } 85 90 } 86 87 /*static*/ void NotificationListener::sendNotificationHelper(const std::string& message, const std::string& sender, unsigned int messageMode) 91 92 /** 93 @brief 94 Helper method to register a notification/execute a command with all NotificationListeners after it has been sent over the network. 95 @param message 96 The notification/command to be sent/executed. 97 @param sender 98 The sender that sent the notification/command. 99 @param isCommand 100 Whether the message is a command or a notification. 101 @param messageType 102 The type of the notification. 103 */ 104 /*static*/ void NotificationListener::sendHelper(const std::string& message, const std::string& sender, bool isCommand, unsigned int messageType) 88 105 { 89 106 // Iterate through all NotificationListeners and notify them by calling the method they overloaded. 90 107 for(ObjectList<NotificationListener>::iterator it = ObjectList<NotificationListener>::begin(); it != ObjectList<NotificationListener>::end(); ++it) 91 108 { 92 if(messageMode == 0 && it->registerNotification(message, sender)) 109 // If the notification is a message. 110 if(!isCommand && it->registerNotification(message, sender, notificationMessageType::Value(messageType))) 93 111 COUT(3) << "Notification \"" << message << "\" sent." << std::endl; 94 95 if(messageMode == 1) 96 it->executeCommand(message, sender); 112 113 // If the notification is a command. 114 if(isCommand) 115 { 116 notificationCommand::Value command = str2Command(message); 117 if(command != notificationCommand::none && it->executeCommand(command, sender)) 118 COUT(3) << "Command \"" << message << "\" executed." << std::endl; 119 } 97 120 } 121 } 122 123 /** 124 @brief 125 Helper method. Converts a string into the enum for a command. 126 @param string 127 The string to be converted. 128 @return 129 Returns the corresponding enum, notificationCommand::none if the command doesn't exist. 130 */ 131 /*static*/ notificationCommand::Value NotificationListener::str2Command(const std::string& string) 132 { 133 notificationCommand::Value command = notificationCommand::none; 134 135 if(string == NotificationListener::COMMAND_CLEAR) 136 command = notificationCommand::clear; 137 138 return command; 98 139 } 99 140 -
code/branches/tutoriallevel2/src/orxonox/interfaces/NotificationListener.h
r8378 r8445 48 48 namespace orxonox 49 49 { 50 51 namespace notificationMessage Mode50 // TODO: Document. 51 namespace notificationMessageType 52 52 { 53 53 enum Value { 54 message,55 command54 info, 55 important 56 56 }; 57 57 } … … 65 65 }; 66 66 } 67 68 namespace notificationCommand 69 { 70 enum Value { 71 none, 72 clear 73 }; 74 } 67 75 68 76 // TODO: Update doc. … … 71 79 NotificationListener interface. 72 80 73 The NotificationListener interface presents a means to being informed when @ref orxonox::Notification "Notifications" in the target set of this NotificationListener change. (e.g. @ref orxonox::Notification "Notifications" were added or removed) 74 When inheriting from a NotificationListener it is important to register (in the constructor) and unregister (in the destructor) it to and from the @ref orxonox::NotificationManager "NotificationManager". 81 The NotificationListener interface (or more precisely abstract class) presents a means of being informed when a new @ref orxonox::Notification "Notification" is sent. 82 The NotificationListener can be used to send a new notification message (with NotificationListener::sendNotification() ) or a new notification command (with NotificationListener::sendCommand() ). Each NotificationListener is then informed about the new @ref orxonox::Notification "Notification" and can take appropriate action. Currently the only NotificationListener ist the @ref orxonox::NotificationManager "NotificationManager" singleton. 83 84 When inheriting from a NotificationListener it is important to provide an appropriate implementation of registerNotification() and executeCommand(). 75 85 76 86 @author … … 78 88 79 89 @ingroup Notifications 90 @todo Consistent terminology between message, notification and command. 80 91 */ 81 92 class _OrxonoxExport NotificationListener : virtual public OrxonoxClass … … 84 95 NotificationListener(); 85 96 virtual ~NotificationListener() {} 97 98 /** 99 @brief Sends a Notification with the specified message to the specified client from the specified sender. 100 @param message The message that should be sent. 101 @param sender The sender that sent the notification. Default is 'none'. 102 @param messageType The type of the message, can be either 'info' or 'important'. Default is 'info'. 103 @param sendMode The mode in which the notification is sent, can be 'local' to send the notification to the client where this function is executed, 'network' if the notification is to be sent to the client with the specified clientID, or 'broadcast' if the notification should be sent to all hosts. Default is notificationSendMode::local. 104 @param clientId The id of the client the notification should be sent to. Default is 0. 105 */ 106 static void sendNotification(const std::string& message, const std::string& sender = NotificationListener::NONE, notificationMessageType::Value messageType = notificationMessageType::info, notificationSendMode::Value sendMode = notificationSendMode::local, unsigned int clientId = 0) 107 { NotificationListener::sendNetworkHelper(message, sender, sendMode, clientId, false, messageType); } 108 /** 109 @brief Sends a specified command to the specified client from the specified sender. 110 @param message The command that should be sent (and later executed). 111 @param sender The sender that sent the notification. Default is 'none'. 112 @param sendMode The mode in which the command is sent, can be 'local' to send the command to the client where this function is executed, 'network' if the command is to be sent to the client with the specified clientID, or 'broadcast' if the command should be sent to all hosts. Default is notificationSendMode::local. 113 @param clientId The id of the client the command should be sent to. Default is 0. 114 */ 115 static void sendCommand(const std::string& command, const std::string& sender = NotificationListener::NONE, notificationSendMode::Value sendMode = notificationSendMode::local, unsigned int clientId = 0) 116 { NotificationListener::sendNetworkHelper(command, sender, sendMode, clientId, true); } 117 118 static void sendHelper(const std::string& message, const std::string& sender, bool isCommand = false, unsigned int messageMode = 0); // Helper method to register a notification/execute a command with all NotificationListeners after it has been sent over the network. 119 120 //TODO: Make protected? 86 121 87 static const std::string ALL; //!< Static string to indicate a sender that sends to all NotificationListeners. 88 static const std::string NONE; //!< Static string to indicare a sender that sends to no specific NotificationListener. 122 /** 123 @brief Registers a notification with the NotificationListener. 124 This needs to be overloaded by each class inheriting from NotificationListener. 125 @param message The notification's message. 126 @param sender The sender of the notification. 127 @param type The type of the notification. 128 @return Returns true if the notification was successfully registered, false if not. 129 */ 130 virtual bool registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type) 131 { return false; } 132 /** 133 @brief Executes a command with the NotificationListener 134 This needs to be overloaded by each class inheriting from NotificationListener. 135 @param command The command to be executed. 136 @param sender The sender of the command. 137 @return Returns true if the command was successfully executed, false if not. 138 */ 139 virtual bool executeCommand(notificationCommand::Value command, const std::string& sender) { return false; } 89 140 90 static void sendNotification(const std::string& message, const std::string& sender = NotificationListener::NONE, notificationMessageMode::Value messageMode = notificationMessageMode::message, notificationSendMode::Value sendMode = notificationSendMode::local, unsigned int clientId = 0);91 static void sendNotificationHelper(const std::string& message, const std::string& sender, unsigned int messageMode);141 static const std::string ALL; //!< Static string to indicate a sender that sends to all NotificationQueues. 142 static const std::string NONE; //!< Static string to indicate a sender that sends to no specific NotificationQueues. 92 143 93 virtual bool registerNotification(const std::string& message, const std::string& sender) { return false; } 94 virtual void executeCommand(const std::string& command, const std::string& sender) {} 144 //! Commands 145 static const std::string COMMAND_CLEAR; 146 147 protected: 148 static void sendNetworkHelper(const std::string& message, const std::string& sender, notificationSendMode::Value sendMode, unsigned int clientId, bool isCommand = false, notificationMessageType::Value messageType = notificationMessageType::info); // Helper method to send both notifications and commands over the network. 149 150 static notificationCommand::Value str2Command(const std::string& string); // Helper method. Converts a string into the enum for a command. 95 151 }; 96 152 }
Note: See TracChangeset
for help on using the changeset viewer.