[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r3771 - gnuradio/branches/developers/jcorgan/cppwrap/g
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r3771 - gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native |
Date: |
Tue, 10 Oct 2006 18:16:02 -0600 (MDT) |
Author: jcorgan
Date: 2006-10-10 18:16:02 -0600 (Tue, 10 Oct 2006)
New Revision: 3771
Modified:
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_flow_graph.cc
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_flow_graph.h
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_scheduler.cc
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_scheduler.h
Log:
Work in progress.
Added stubs to gr_scheduler as needed.
Modified:
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_flow_graph.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_flow_graph.cc
2006-10-10 23:17:36 UTC (rev 3770)
+++
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_flow_graph.cc
2006-10-11 00:16:02 UTC (rev 3771)
@@ -276,20 +276,33 @@
void gr_flow_graph::start()
{
- // TODO: check if already started
+ if (d_scheduler)
+ throw std::runtime_error("Scheduler already running!");
+
create_block_list();
connect_blocks();
- // TODO: instantiate scheduler and call it with block list
+ d_scheduler = gr_make_scheduler(shared_from_this());
+ d_scheduler->start();
+
printf("If this were a real program, something interesting would have just
happened.\n");
}
void gr_flow_graph::stop()
{
+ if (!d_scheduler)
+ throw std::runtime_error("Scheduler not running!");
+
+ d_scheduler->stop();
+ d_scheduler.reset();
}
void gr_flow_graph::wait()
{
+ if (!d_scheduler)
+ throw std::runtime_error("Scheduler not running!");
+ d_scheduler->wait();
+ d_scheduler.reset();
}
void gr_flow_graph::run()
@@ -297,3 +310,5 @@
start();
wait();
}
+
+// Topological sort and partition functions here
Modified:
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_flow_graph.h
===================================================================
---
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_flow_graph.h
2006-10-10 23:17:36 UTC (rev 3770)
+++
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_flow_graph.h
2006-10-11 00:16:02 UTC (rev 3771)
@@ -23,6 +23,8 @@
#define INCLUDED_GR_FLOW_GRAPH_H
#include <gr_block.h>
+#include <gr_scheduler.h>
+#include <boost/enable_shared_from_this.hpp>
typedef std::vector<gr_block_sptr> gr_block_vector_t;
typedef std::vector<gr_block_sptr>::iterator gr_block_vector_iterator_t;
@@ -38,7 +40,7 @@
#define GR_FIXED_BUFFER_SIZE 32000
-class gr_flow_graph
+class gr_flow_graph : public boost::enable_shared_from_this<gr_flow_graph>
{
private:
gr_flow_graph();
@@ -63,7 +65,10 @@
static const int s_fixed_buffer_size = GR_FIXED_BUFFER_SIZE;
gr_edge_vector_t d_edges;
gr_block_vector_t d_blocks;
+ gr_scheduler_sptr d_scheduler;
+ // Topological sort and partition functions here
+
public:
~gr_flow_graph();
void connect(gr_block_sptr src_block, int src_port,
Modified:
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_scheduler.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_scheduler.cc
2006-10-10 23:17:36 UTC (rev 3770)
+++
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_scheduler.cc
2006-10-11 00:16:02 UTC (rev 3771)
@@ -30,9 +30,22 @@
gr_scheduler::gr_scheduler(gr_flow_graph_sptr fg) :
d_fg(fg)
{
+ // NOP
}
gr_scheduler::~gr_scheduler()
{
// NOP
}
+
+void gr_scheduler::start()
+{
+}
+
+void gr_scheduler::stop()
+{
+}
+
+void gr_scheduler::wait()
+{
+}
Modified:
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_scheduler.h
===================================================================
---
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_scheduler.h
2006-10-10 23:17:36 UTC (rev 3770)
+++
gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native/gr_scheduler.h
2006-10-11 00:16:02 UTC (rev 3771)
@@ -22,6 +22,7 @@
#ifndef INCLUDED_GR_SCHEDULER_H
#define INCLUDED_GR_SCHEDULER_H
+#include <vector>
#include <boost/shared_ptr.hpp>
class gr_scheduler;
@@ -33,6 +34,9 @@
gr_scheduler_sptr gr_make_scheduler(gr_flow_graph_sptr fg);
+typedef std::vector<gr_scheduler> gr_scheduler_vector_t;
+typedef std::vector<gr_scheduler>::iterator gr_scheduler_vector_iterator_t;
+
class gr_scheduler
{
private:
@@ -43,8 +47,10 @@
public:
~gr_scheduler();
+
+ void start();
+ void stop();
+ void wait();
};
#endif /* INCLUDED_GR_SCHEDULER_H */
-
-
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r3771 - gnuradio/branches/developers/jcorgan/cppwrap/gnuradio-examples/native,
jcorgan <=