From a7317d45787669af71ca8c65fd1e51f8a47d2c1e Mon Sep 17 00:00:00 2001 From: imarom Date: Thu, 19 Nov 2015 12:35:16 +0200 Subject: async events (DP to CP) --- src/publisher/trex_publisher.h | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'src/publisher/trex_publisher.h') diff --git a/src/publisher/trex_publisher.h b/src/publisher/trex_publisher.h index 7c3fff92..07d06678 100644 --- a/src/publisher/trex_publisher.h +++ b/src/publisher/trex_publisher.h @@ -25,36 +25,6 @@ limitations under the License. #include #include -/** - * base event type - * - */ -class TrexPublisherEvent { -public: - virtual void to_json(Json::Value &json) = 0; - virtual uint8_t get_type() = 0; - -protected: - enum { - EVENT_PORT_STOPPED = 1 - }; - -}; - -/** - * port stopped transmitting - * - */ -class TrexEventPortStopped : public TrexPublisherEvent { -public: - TrexEventPortStopped(uint8_t port_id); - virtual void to_json(Json::Value &json); - virtual uint8_t get_type() { - return (EVENT_PORT_STOPPED); - } -}; - - class TrexPublisher { public: @@ -68,7 +38,11 @@ public: void Delete(); void publish_json(const std::string &s); - void publish_event(TrexPublisherEvent *ev); + enum event_type_e { + EVENT_PORT_STOPPED = 1 + }; + + void publish_event(event_type_e type, const Json::Value &data); private: void show_zmq_last_error(const std::string &err); -- cgit 1.2.3-korg