Class ActionPublisher
Defined in File action-publisher.h
Inheritance Relationships
Base Types
public gpa::runtime::EventPublisher::Subscriber
(Struct EventPublisher::Subscriber)public ActionListener
Class Documentation
-
class ActionPublisher : public gpa::runtime::EventPublisher::Subscriber, public ActionListener
Publishes actions generated by runtime::ActionGenerator.
ActionPublisher takes the actions generated by runtime::ActionGenerator and makes them available to any event subscribers listening on the "actions" topic. Actions are published in text form, so subscribers will need to be prepared to handle textual action verbs.
Public Functions
-
ActionPublisher(ActionGenerator *actionGenerator)
-
~ActionPublisher()
-
ActionPublisher(const ActionPublisher&) = delete
-
ActionPublisher &operator=(const ActionPublisher&) = delete
-
void OnAction(char const *action) override
-
virtual void OnEvent(char const*, gpa::runtime::EventData const &event) override
When an event/message is available on a topic for which this subscriber has registered, it will be delivered via this method.
Note
If the data in the event/message needs to be used beyond the scope of this method, the implementation should copy the relevant contents of the event/message and not attempt to cache the event object itself, as there is no guarantee that the event object will be available beyond this method's return.
- Parameters
topic -- Name of the topic ("channel") on which the event was published.
event -- The event data. The implementation should use the EventData::ID() method to determine the actual event/message type, and cast accordingly.
-
ActionPublisher(ActionGenerator *actionGenerator)