summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/delay_impl.cc
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2014-08-14 11:21:32 -0400
committerTom Rondeau <tom@trondeau.com>2014-08-14 11:21:32 -0400
commit3897c850322eb51f72ec4e55e2c35c7429c90337 (patch)
tree4fc7d8606447ee8b135e044710ebe4a6cad86a96 /gr-blocks/lib/delay_impl.cc
parentd10b68fd7d7194732d9eccb5edcf0e68ebdb8d6b (diff)
blocks: delay block cannot be initialized with a negative number.
This commit puts in a check in the constructor and better documentation about the behavior.
Diffstat (limited to 'gr-blocks/lib/delay_impl.cc')
-rw-r--r--gr-blocks/lib/delay_impl.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gr-blocks/lib/delay_impl.cc b/gr-blocks/lib/delay_impl.cc
index 7ae4037780..0ebe124b09 100644
--- a/gr-blocks/lib/delay_impl.cc
+++ b/gr-blocks/lib/delay_impl.cc
@@ -44,6 +44,9 @@ namespace gr {
io_signature::make(1, -1, itemsize)),
d_itemsize(itemsize)
{
+ if(delay < 0) {
+ throw std::runtime_error("delay: Cannot initialize block with a delay < 0.");
+ }
set_dly(delay);
d_delta = 0;
}