23 #ifndef INCLUDED_GR_RUNTIME_HIER_BLOCK2_H 24 #define INCLUDED_GR_RUNTIME_HIER_BLOCK2_H 38 class hier_block2_detail;
48 friend class hier_block2_detail;
57 hier_block2_detail* d_detail;
94 void connect(basic_block_sptr
block);
104 void connect(basic_block_sptr src,
int src_port, basic_block_sptr dst,
int dst_port);
114 void msg_connect(basic_block_sptr src,
116 basic_block_sptr dst,
118 void msg_connect(basic_block_sptr src,
120 basic_block_sptr dst,
121 std::string dstport);
122 void msg_disconnect(basic_block_sptr src,
124 basic_block_sptr dst,
126 void msg_disconnect(basic_block_sptr src,
128 basic_block_sptr dst,
129 std::string dstport);
138 void disconnect(basic_block_sptr
block);
148 disconnect(basic_block_sptr src,
int src_port, basic_block_sptr dst,
int dst_port);
156 void disconnect_all();
178 virtual void unlock();
183 int max_output_buffer(
size_t port = 0);
188 void set_max_output_buffer(
int max_output_buffer);
193 void set_max_output_buffer(
size_t port,
int max_output_buffer);
198 int min_output_buffer(
size_t port = 0);
203 void set_min_output_buffer(
int min_output_buffer);
208 void set_min_output_buffer(
size_t port,
int min_output_buffer);
213 flat_flowgraph_sptr flatten()
const;
215 hier_block2_sptr to_hier_block2();
224 return message_port_is_hier_in(port_id) || message_port_is_hier_out(port_id);
243 throw std::invalid_argument(
244 "hier msg in port by this name already registered");
246 throw std::invalid_argument(
247 "block already has a primitive input port by this name");
248 hier_message_ports_in =
pmt::list_add(hier_message_ports_in, port_id);
254 throw std::invalid_argument(
255 "hier msg out port by this name already registered");
257 throw std::invalid_argument(
258 "block already has a primitive output port by this name");
259 hier_message_ports_out =
pmt::list_add(hier_message_ports_out, port_id);
267 void set_processor_affinity(
const std::vector<int>& mask);
272 void unset_processor_affinity();
283 std::vector<int> processor_affinity();
303 void set_log_level(std::string level);
308 std::string log_level();
316 bool all_min_output_buffer_p(
void);
324 bool all_max_output_buffer_p(
void);
332 inline hier_block2_sptr cast_to_hier_block2_sptr(basic_block_sptr
block)
boost::shared_ptr< io_signature > sptr
Definition: io_signature.h:46
void message_port_register_hier_out(pmt::pmt_t port_id)
Definition: hier_block2.h:251
bool message_port_is_hier(pmt::pmt_t port_id)
Definition: hier_block2.h:222
PMT_API bool list_has(pmt_t list, const pmt_t &item)
Return bool of list contains item.
boost::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:96
void message_port_register_hier_in(pmt::pmt_t port_id)
Definition: hier_block2.h:240
bool has_msg_port(pmt::pmt_t which_port)
Definition: hier_block2.h:217
virtual bool has_msg_port(pmt::pmt_t which_port)
Definition: basic_block.h:286
basic_block_sptr opaque_self
typedef for object returned from self().
Definition: hier_block2.h:75
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
thread-safe message queue
Definition: msg_queue.h:36
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
GR_RUNTIME_API std::string dot_graph(hier_block2_sptr hierblock2)
Return hierarchical block's flow graph represented in dot language.
The abstract base class for all signal processing blocks.Basic blocks are the bare abstraction of an ...
Definition: basic_block.h:56
bool message_port_is_hier_in(pmt::pmt_t port_id)
Definition: hier_block2.h:227
bool message_port_is_hier_out(pmt::pmt_t port_id)
Definition: hier_block2.h:232
hier_block2(void)
Definition: hier_block2.h:61
pmt::pmt_t hier_message_ports_in
Definition: hier_block2.h:237
pmt::pmt_t hier_message_ports_out
Definition: hier_block2.h:238
PMT_API pmt_t list_add(pmt_t list, const pmt_t &item)
Return list with item added to it.
PMT_API bool dict_has_key(const pmt_t &dict, const pmt_t &key)
Return true if key exists in dict.
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:71
GR_RUNTIME_API hier_block2_sptr make_hier_block2(const std::string &name, gr::io_signature::sptr input_signature, gr::io_signature::sptr output_signature)
public constructor for hier_block2
Hierarchical container class for gr::block's and gr::hier_block2's.
Definition: hier_block2.h:45