/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
#include <sys/stat.h>
#include <fcntl.h>
#include <stdexcept>
+#include <string.h>
// public constructor that returns a shared_ptr
gr_message_source_sptr
gr_make_message_source(size_t itemsize, int msgq_limit)
{
- return gr_message_source_sptr(new gr_message_source(itemsize, msgq_limit));
+ return gnuradio::get_initial_sptr(new gr_message_source(itemsize, msgq_limit));
+}
+
+// public constructor that takes existing message queue
+gr_message_source_sptr
+gr_make_message_source(size_t itemsize, gr_msg_queue_sptr msgq)
+{
+ return gnuradio::get_initial_sptr(new gr_message_source(itemsize, msgq));
}
gr_message_source::gr_message_source (size_t itemsize, int msgq_limit)
{
}
+gr_message_source::gr_message_source (size_t itemsize, gr_msg_queue_sptr msgq)
+ : gr_sync_block("message_source",
+ gr_make_io_signature(0, 0, 0),
+ gr_make_io_signature(1, 1, itemsize)),
+ d_itemsize(itemsize), d_msgq(msgq), d_msg_offset(0), d_eof(false)
+{
+}
+
gr_message_source::~gr_message_source()
{
}