summaryrefslogtreecommitdiffstats
path: root/src/stateless
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-09-01 17:16:27 +0300
committerimarom <imarom@cisco.com>2015-09-01 17:16:27 +0300
commitc17add108ead1ffbdf0c909684c5f8b18632f3d8 (patch)
tree338c32c9cc782afb35948d69714d4dba4cf6151f /src/stateless
parent166e1b639a8cb3d95a6ebae325a4156c6df6c595 (diff)
draft
Diffstat (limited to 'src/stateless')
-rw-r--r--src/stateless/trex_stream.cpp10
-rw-r--r--src/stateless/trex_stream_api.h9
2 files changed, 17 insertions, 2 deletions
diff --git a/src/stateless/trex_stream.cpp b/src/stateless/trex_stream.cpp
index 5bc9421f..1465b1ba 100644
--- a/src/stateless/trex_stream.cpp
+++ b/src/stateless/trex_stream.cpp
@@ -72,6 +72,16 @@ void TrexStreamTable::remove_stream(TrexStream *stream) {
m_stream_table.erase(stream->m_stream_id);
}
+
+void TrexStreamTable::remove_and_delete_all_streams() {
+
+ for (auto stream : m_stream_table) {
+ delete stream.second;
+ }
+
+ m_stream_table.clear();
+}
+
TrexStream * TrexStreamTable::get_stream_by_id(uint32_t stream_id) {
auto search = m_stream_table.find(stream_id);
diff --git a/src/stateless/trex_stream_api.h b/src/stateless/trex_stream_api.h
index bae82862..f57b7aae 100644
--- a/src/stateless/trex_stream_api.h
+++ b/src/stateless/trex_stream_api.h
@@ -66,7 +66,7 @@ private:
/* RX check */
struct {
bool m_enable;
- bool m_seq_enable;
+ bool m_seq_enabled;
bool m_latency;
uint32_t m_stream_id;
@@ -141,11 +141,16 @@ public:
/**
* remove a stream
- *
*/
void remove_stream(TrexStream *stream);
/**
+ * remove all streams on the table
+ * memory will be deleted
+ */
+ void remove_and_delete_all_streams();
+
+ /**
* fetch a stream if exists
* o.w NULL
*