summaryrefslogtreecommitdiffstats
path: root/src/publisher
diff options
context:
space:
mode:
Diffstat (limited to 'src/publisher')
-rw-r--r--src/publisher/trex_publisher.cpp15
-rw-r--r--src/publisher/trex_publisher.h12
2 files changed, 27 insertions, 0 deletions
diff --git a/src/publisher/trex_publisher.cpp b/src/publisher/trex_publisher.cpp
index 35653069..f56d56df 100644
--- a/src/publisher/trex_publisher.cpp
+++ b/src/publisher/trex_publisher.cpp
@@ -94,6 +94,21 @@ TrexPublisher::publish_event(event_type_e type, const Json::Value &data) {
publish_json(s);
}
+void
+TrexPublisher::publish_barrier(uint32_t key) {
+ Json::FastWriter writer;
+ Json::Value value;
+ std::string s;
+
+ value["name"] = "trex-barrier";
+ value["type"] = key;
+ value["data"] = Json::objectValue;
+
+ s = writer.write(value);
+ publish_json(s);
+}
+
+
/**
* error handling
*
diff --git a/src/publisher/trex_publisher.h b/src/publisher/trex_publisher.h
index 52978476..f086babb 100644
--- a/src/publisher/trex_publisher.h
+++ b/src/publisher/trex_publisher.h
@@ -53,8 +53,20 @@ public:
};
+ /**
+ * publishes an async event
+ *
+ */
virtual void publish_event(event_type_e type, const Json::Value &data = Json::nullValue);
+ /**
+ * publishes a barrier requested by the user
+ *
+ * @author imarom (17-Jan-16)
+ *
+ */
+ virtual void publish_barrier(uint32_t key);
+
private:
void show_zmq_last_error(const std::string &err);
private: