/* -*- 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.
*
// Dump the flowgraph to stdout
void dump();
-
- // Return true if flowgraph is running
- bool is_running() const { return d_running; }
-private:
+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();
};