Merge r6160:6168 from jcorgan/fg into trunk.
[debian/gnuradio] / gnuradio-core / src / lib / runtime / gr_basic_block.h
index c47430e12517018d55093773205e2f9b7cb0b522..b2b8b42a369f7d46fb810d87e8bd52bf6a8a48e5 100644 (file)
 class gr_basic_block : public boost::enable_shared_from_this<gr_basic_block>
 {
 protected:
+    friend class gr_flowgraph;
+    friend class gr_flat_flowgraph; // TODO: will be redundant
+
+    enum vcolor { WHITE, GREY, BLACK };
+
     std::string          d_name;
     gr_io_signature_sptr d_input_signature;
     gr_io_signature_sptr d_output_signature;
     long                 d_unique_id;
+    vcolor               d_color;
 
     //! Protected constructor prevents instantiation by non-derived classes
     gr_basic_block(const std::string &name,
@@ -61,6 +67,12 @@ protected:
         d_output_signature = iosig;
     }
 
+    /*!
+     * \brief Allow the flowgraph to set for sorting and partitioning
+     */
+    void set_color(vcolor color) { d_color = color; }
+    vcolor color() const { return d_color; }
+
 public:
     virtual ~gr_basic_block();
     long unique_id() const { return d_unique_id; }