Merge commit 'v3.3.0' into upstream
[debian/gnuradio] / gnuradio-core / src / lib / runtime / gr_top_block_impl.h
index 8052ce4fabda0f69efaa476ce40e501de2e1af94..ef28dd8292124803f1162b85515b2313d4da0475 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2008 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
 #ifndef INCLUDED_GR_TOP_BLOCK_IMPL_H
 #define INCLUDED_GR_TOP_BLOCK_IMPL_H
 
-#include <gr_scheduler_thread.h>
+#include <gr_scheduler.h>
+#include <gruel/thread.h>
 
 /*!
- *\brief Implementation details of gr_top_block
+ *\brief Abstract implementation details of gr_top_block
+ * \ingroup internal
  *
  * The actual implementation of gr_top_block. Separate class allows
  * decoupling of changes from dependent classes.
@@ -53,18 +55,22 @@ public:
   // Unlock the top block at end of reconfiguration
   void unlock();
 
-private:
+  // Dump the flowgraph to stdout
+  void dump();
+  
+protected:
     
-  bool                           d_running;
-  gr_flat_flowgraph_sptr         d_ffg;
-  gr_scheduler_thread_vector_t   d_threads;
-  gr_top_block                  *d_owner;
-  int                            d_lock_count;
-  omni_mutex                     d_reconf;
+  enum tb_state { IDLE, RUNNING };
 
-  std::vector<gr_basic_block_vector_t> d_graphs;
+  gr_top_block                  *d_owner;
+  gr_flat_flowgraph_sptr         d_ffg;
+  gr_scheduler_sptr             d_scheduler;
 
-  void start_threads();
+  gruel::mutex                   d_mutex;      // protects d_state and d_lock_count
+  tb_state                      d_state;
+  int                            d_lock_count;
+  
+private:
   void restart();
 };