summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosh Blum2013-03-29 03:22:28 -0500
committerJosh Blum2013-03-29 03:22:28 -0500
commite78ac3e9582f46670a904f119d2ee80d7310b42e (patch)
treea24d20db2631c9d9e3d41642ee604228d5495e14 /lib
parentca6d6b4a7786ecc3754532d85ed39da33684d5fc (diff)
parentd6f413965cc91fd239f7ba587e9550233b386cc5 (diff)
downloadsandhi-e78ac3e9582f46670a904f119d2ee80d7310b42e.tar.gz
sandhi-e78ac3e9582f46670a904f119d2ee80d7310b42e.tar.bz2
sandhi-e78ac3e9582f46670a904f119d2ee80d7310b42e.zip
Merge branch 'master' into query_work
Diffstat (limited to 'lib')
-rw-r--r--lib/block.cpp5
-rw-r--r--lib/element.cpp5
-rw-r--r--lib/gras_impl/input_buffer_queues.hpp22
-rw-r--r--lib/hier_block.cpp5
-rw-r--r--lib/top_block.cpp5
5 files changed, 31 insertions, 11 deletions
diff --git a/lib/block.cpp b/lib/block.cpp
index d2f0a0d..5bb959b 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -46,6 +46,11 @@ Block::Block(const std::string &name):
this->set_buffer_affinity(-1);
}
+Block::~Block(void)
+{
+ //NOP
+}
+
void ElementImpl::block_cleanup(void)
{
//wait for actor to chew through enqueued messages
diff --git a/lib/element.cpp b/lib/element.cpp
index 4adc92c..f291310 100644
--- a/lib/element.cpp
+++ b/lib/element.cpp
@@ -26,6 +26,11 @@ Element::Element(const std::string &name)
if (GENESIS) std::cerr << "New element: " << to_string() << std::endl;
}
+Element::~Element(void)
+{
+ //NOP
+}
+
ElementImpl::~ElementImpl(void)
{
if (this->executor) this->top_block_cleanup();
diff --git a/lib/gras_impl/input_buffer_queues.hpp b/lib/gras_impl/input_buffer_queues.hpp
index 48996ef..48533b9 100644
--- a/lib/gras_impl/input_buffer_queues.hpp
+++ b/lib/gras_impl/input_buffer_queues.hpp
@@ -117,9 +117,13 @@ struct InputBufferQueues
GRAS_FORCE_INLINE void flush_all(void)
{
- const size_t old_size = this->size();
- this->resize(0);
- this->resize(old_size);
+ //clear all data in queues and update vars to reflect
+ for (size_t i = 0; i < this->size(); i++)
+ {
+ _queues[i] = boost::circular_buffer<SBuffer>(1);
+ _enqueued_bytes[i] = 0;
+ this->__update(i);
+ }
}
GRAS_FORCE_INLINE bool ready(const size_t i) const
@@ -164,14 +168,10 @@ GRAS_FORCE_INLINE void InputBufferQueues::resize(const size_t size)
_enqueued_bytes.resize(size, 0);
_queues.resize(size, boost::circular_buffer<SBuffer>(1));
_aux_queues.resize(size);
-
- if (size != 0) //keep config info when flushing
- {
- _items_sizes.resize(size, 0);
- _preload_bytes.resize(size, 0);
- _reserve_bytes.resize(size, 1);
- _maximum_bytes.resize(size, MAX_AUX_BUFF_BYTES);
- }
+ _items_sizes.resize(size, 0);
+ _preload_bytes.resize(size, 0);
+ _reserve_bytes.resize(size, 1);
+ _maximum_bytes.resize(size, MAX_AUX_BUFF_BYTES);
}
inline void InputBufferQueues::update_config(
diff --git a/lib/hier_block.cpp b/lib/hier_block.cpp
index b7ffe4c..4c0aef3 100644
--- a/lib/hier_block.cpp
+++ b/lib/hier_block.cpp
@@ -18,6 +18,11 @@ HierBlock::HierBlock(const std::string &name):
(*this)->topology = boost::shared_ptr<Apology::Topology>(new Apology::Topology());
}
+HierBlock::~HierBlock(void)
+{
+ //NOP
+}
+
void ElementImpl::hier_block_cleanup(void)
{
this->topology->clear_all();
diff --git a/lib/top_block.cpp b/lib/top_block.cpp
index 10d5ef2..5370920 100644
--- a/lib/top_block.cpp
+++ b/lib/top_block.cpp
@@ -30,6 +30,11 @@ TopBlock::TopBlock(const std::string &name):
<< std::flush;
}
+TopBlock::~TopBlock(void)
+{
+ //NOP
+}
+
void ElementImpl::top_block_cleanup(void)
{
this->pre_post_all_set_prio();