packet dropper: format, fix includes, no API in _impl

This commit is contained in:
Bastian Bloessl
2013-06-05 07:54:47 +02:00
parent ee0408c878
commit 8ebbc5cb0d
2 changed files with 8 additions and 7 deletions
+7 -6
View File
@@ -15,17 +15,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <foo/packet_dropper.h>
#include <gnuradio/io_signature.h>
#include <gnuradio/block_detail.h>
#include "packet_dropper_impl.h" #include "packet_dropper_impl.h"
#include <gnuradio/io_signature.h>
using namespace gr::foo; using namespace gr::foo;
packet_dropper_impl::packet_dropper_impl(double drop_rate, unsigned long seed) packet_dropper_impl::packet_dropper_impl(double drop_rate, unsigned long seed)
: d_drop_rate(drop_rate), d_generator(seed), d_distribution(0.0,1.0), : block("packet_dropper",
block("rime_stack", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0),
gr::io_signature::make(0, 0, 0)) gr::io_signature::make(0, 0, 0)),
d_drop_rate(drop_rate),
d_generator(seed),
d_distribution(0.0, 1.0)
{ {
if(d_drop_rate >= 1){ if(d_drop_rate >= 1){
throw std::out_of_range("drop rate has to be < 1"); throw std::out_of_range("drop rate has to be < 1");
+1 -1
View File
@@ -22,7 +22,7 @@
namespace gr { namespace gr {
namespace foo { namespace foo {
class FOO_API packet_dropper_impl : public packet_dropper { class packet_dropper_impl : public packet_dropper {
private: private:
double d_drop_rate; double d_drop_rate;
std::default_random_engine d_generator; std::default_random_engine d_generator;