diff options
author | Josh Blum | 2012-09-02 17:09:46 -0700 |
---|---|---|
committer | Josh Blum | 2012-09-02 17:09:46 -0700 |
commit | 591905b3a33982a46e8c956d4ca226bb4a241b54 (patch) | |
tree | 897a168667fa8048e816a131428f81c830892942 /lib/block_handlers.cpp | |
parent | 814be255443ef4ada223375263ee3d2ad43540c1 (diff) | |
download | sandhi-591905b3a33982a46e8c956d4ca226bb4a241b54.tar.gz sandhi-591905b3a33982a46e8c956d4ca226bb4a241b54.tar.bz2 sandhi-591905b3a33982a46e8c956d4ca226bb4a241b54.zip |
created history implementation (untested)
Diffstat (limited to 'lib/block_handlers.cpp')
-rw-r--r-- | lib/block_handlers.cpp | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp index 396416d..4e6b732 100644 --- a/lib/block_handlers.cpp +++ b/lib/block_handlers.cpp @@ -113,7 +113,6 @@ void ElementImpl::topology_update(const tsbe::TaskInterface &task_iface) this->output_items.resize(num_outputs); this->consume_items.resize(num_inputs, 0); this->produce_items.resize(num_outputs, 0); - this->input_buff_offsets.resize(num_inputs, 0); this->input_queues.resize(num_inputs); this->output_queues.resize(num_outputs); @@ -125,30 +124,8 @@ void ElementImpl::topology_update(const tsbe::TaskInterface &task_iface) this->input_tags.resize(num_inputs); this->output_tags.resize(num_outputs); - //determine max history length for allocation below - this->max_history_items = *std::max_element( - this->input_history_items.begin(), - this->input_history_items.end() - ); - - //resize and clear that initial history - this->history_buffs.resize(num_inputs); - this->input_history_bytes.resize(num_inputs); - for (size_t i = 0; i < num_inputs; i++) - { - tsbe::Buffer &buff = this->history_buffs[i]; - const size_t num_items = this->input_history_items[i] + this->max_history_items; - const size_t num_bytes = this->input_items_sizes[i]*num_items; - this->input_history_bytes[i] = num_bytes; - if (not buff or buff.get_length() != num_bytes) - { - tsbe::BufferConfig config; - config.memory = NULL; - config.length = num_bytes; - buff = tsbe::Buffer(config); - std::memset(buff.get_memory(), 0, buff.get_length()); - } - } + //init the history comprehension on input queues + this->input_queues.init(this->input_history_items, this->input_items_sizes); //TODO: think more about this: if (num_inputs == 0 and num_outputs == 0) |