23 #ifndef INCLUDED_GR_RUNTIME_FLOWGRAPH_H 24 #define INCLUDED_GR_RUNTIME_FLOWGRAPH_H 40 basic_block_sptr d_basic_block;
47 d_basic_block = block;
50 basic_block_sptr
block()
const {
return d_basic_block; }
51 int port()
const {
return d_port; }
54 return d_basic_block->alias() +
":" + std::to_string(d_port);
57 bool operator==(
const endpoint& other)
const;
62 return (d_basic_block == other.d_basic_block && d_port == other.d_port);
68 basic_block_sptr d_basic_block;
76 d_basic_block = block;
80 basic_block_sptr
block()
const {
return d_basic_block; }
82 bool is_hier()
const {
return d_is_hier; }
94 return (d_basic_block == other.d_basic_block &&
pmt::equal(d_port, other.d_port));
115 return d_src.identifier() +
"->" + d_dst.identifier();
142 return d_src.identifier() +
"->" + d_dst.identifier();
189 void connect(basic_block_sptr src_block,
191 basic_block_sptr dst_block,
197 void disconnect(basic_block_sptr src_block,
199 basic_block_sptr dst_block,
231 const edge_vector_t&
edges()
const {
return d_edges; }
236 const msg_edge_vector_t&
msg_edges()
const {
return d_msg_edges; }
261 std::vector<basic_block_vector_t> partition();
269 std::vector<int> calc_used_ports(basic_block_sptr
block,
bool check_inputs);
271 edge_vector_t calc_upstream_edges(basic_block_sptr
block);
272 bool has_block_p(basic_block_sptr
block);
273 edge calc_upstream_edge(basic_block_sptr
block,
int port);
278 void check_dst_not_used(
const endpoint& dst);
280 edge_vector_t calc_connections(basic_block_sptr
block,
282 void check_contiguity(basic_block_sptr
block,
283 const std::vector<int>& used_ports,
293 bool source_p(basic_block_sptr
block);
300 basic_block_sptr dst_block,
308 basic_block_sptr dst_block,
const msg_edge_vector_t & msg_edges() const
Get vector of message edges.
Definition: flowgraph.h:236
int port() const
Definition: flowgraph.h:51
endpoint()
Definition: flowgraph.h:44
boost::shared_ptr< io_signature > sptr
Definition: io_signature.h:46
bool operator==(const endpoint &other) const
Definition: flowgraph.h:60
std::string dot_graph_fg(flowgraph_sptr fg)
std::vector< msg_edge >::iterator msg_edge_viter_t
Definition: flowgraph.h:152
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
const edge_vector_t & edges() const
Get vector of edges.
Definition: flowgraph.h:231
basic_block_sptr block() const
Definition: flowgraph.h:80
std::string identifier() const
Definition: flowgraph.h:140
~msg_edge()
Definition: flowgraph.h:136
msg_edge_vector_t d_msg_edges
Definition: flowgraph.h:266
msg_endpoint()
Definition: flowgraph.h:73
const endpoint & src() const
Definition: flowgraph.h:111
const endpoint & dst() const
Definition: flowgraph.h:112
basic_block_sptr block() const
Definition: flowgraph.h:50
Class representing a directed, acyclic graph of basic blocks.
Definition: flowgraph.h:162
std::string identifier() const
Definition: flowgraph.h:113
PMT_API const std::string symbol_to_string(const pmt_t &sym)
std::vector< endpoint > endpoint_vector_t
Definition: flowgraph.h:98
void connect(const endpoint &src, const endpoint &dst)
Connect two endpoints.
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
edge()
Definition: flowgraph.h:107
basic_block_vector_t d_blocks
Definition: flowgraph.h:264
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
PMT_API bool equal(const pmt_t &x, const pmt_t &y)
pmt::pmt_t port() const
Definition: flowgraph.h:81
std::string identifier() const
Definition: flowgraph.h:84
edge_vector_t d_edges
Definition: flowgraph.h:265
bool is_hier() const
Definition: flowgraph.h:82
#define PMT_NIL
Definition: pmt.h:134
std::vector< endpoint >::iterator endpoint_viter_t
Definition: flowgraph.h:99
Class representing a specific input or output graph endpoint.
Definition: flowgraph.h:37
edge(const endpoint &src, const endpoint &dst)
Definition: flowgraph.h:108
Class representing a connection between to graph endpoints.
Definition: flowgraph.h:104
endpoint(basic_block_sptr block, int port)
Definition: flowgraph.h:45
std::vector< basic_block_sptr > basic_block_vector_t
Definition: basic_block.h:411
std::ostream & operator<<(std::ostream &os, basic_block_sptr basic_block)
Definition: basic_block.h:416
std::vector< edge >::iterator edge_viter_t
Definition: flowgraph.h:125
msg_endpoint(basic_block_sptr block, pmt::pmt_t port, bool is_hier=false)
Definition: flowgraph.h:74
const msg_endpoint & dst() const
Definition: flowgraph.h:139
msg_edge(const msg_endpoint &src, const msg_endpoint &dst)
Definition: flowgraph.h:135
std::vector< edge > edge_vector_t
Definition: flowgraph.h:124
Definition: flowgraph.h:65
void set_hier(bool h)
Definition: flowgraph.h:83
std::vector< msg_edge > msg_edge_vector_t
Definition: flowgraph.h:151
msg_edge()
Definition: flowgraph.h:134
GR_RUNTIME_API flowgraph_sptr make_flowgraph()
bool operator==(const msg_endpoint &other) const
Definition: flowgraph.h:92
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:71
void disconnect(const endpoint &src, const endpoint &dst)
Disconnect two endpoints.
Class representing a msg connection between to graph msg endpoints.
Definition: flowgraph.h:131
std::string identifier() const
Definition: flowgraph.h:52
const msg_endpoint & src() const
Definition: flowgraph.h:138