summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosh Blum2012-09-03 14:38:56 -0700
committerJosh Blum2012-09-03 14:38:56 -0700
commit20fc18a2a9f4c47f8e782f15d82aaf5f49d7f0aa (patch)
tree2f012ffcc091b86fa6a6f2f7666de7cca44826d7 /lib
parent39545d55cd89f1dbb8092cfed6864d40db56ac0e (diff)
downloadsandhi-20fc18a2a9f4c47f8e782f15d82aaf5f49d7f0aa.tar.gz
sandhi-20fc18a2a9f4c47f8e782f15d82aaf5f49d7f0aa.tar.bz2
sandhi-20fc18a2a9f4c47f8e782f15d82aaf5f49d7f0aa.zip
create default works for gr sync and block
Diffstat (limited to 'lib')
-rw-r--r--lib/block.cpp5
-rw-r--r--lib/gr_block.cpp9
-rw-r--r--lib/gr_sync_block.cpp8
3 files changed, 21 insertions, 1 deletions
diff --git a/lib/block.cpp b/lib/block.cpp
index 8329d53..7ac2144 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -71,8 +71,11 @@ size_t Block::history(const size_t which_input) const
return vector_get((*this)->input_history_items, which_input);
}
-void Block::set_history(const size_t history, const size_t which_input)
+void Block::set_history(const size_t history_, const size_t which_input)
{
+ //FIXME history of 1 actually means no history, why is this?
+ //odd because I'm fairly certain history of N means N
+ const size_t history = (history_ == 1)? 0 : history_;
vector_set((*this)->input_history_items, history, which_input);
}
diff --git a/lib/gr_block.cpp b/lib/gr_block.cpp
index cef94b6..ce1b09e 100644
--- a/lib/gr_block.cpp
+++ b/lib/gr_block.cpp
@@ -46,6 +46,15 @@ int gr_block::Work(
);
}
+int gr_block::general_work(
+ int noutput_items,
+ gr_vector_int &ninput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items
+){
+ throw std::runtime_error("gr_block subclasses must overload general_work!");
+}
+
void gr_block::set_alignment(const size_t)
{
//TODO
diff --git a/lib/gr_sync_block.cpp b/lib/gr_sync_block.cpp
index 2cd3879..5344ac8 100644
--- a/lib/gr_sync_block.cpp
+++ b/lib/gr_sync_block.cpp
@@ -34,6 +34,14 @@ gr_sync_block::gr_sync_block(
this->set_fixed_rate(true);
}
+int gr_sync_block::work(
+ int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items
+){
+ throw std::runtime_error("gr_block subclasses must overload general_work!");
+}
+
gr_sync_interpolator::gr_sync_interpolator(void)
{
//NOP