23 #ifndef INCLUDED_GR_RUNTIME_FLOWGRAPH_H
24 #define INCLUDED_GR_RUNTIME_FLOWGRAPH_H
40 basic_block_sptr d_basic_block;
45 endpoint(basic_block_sptr
block,
int port) { d_basic_block = block; d_port = port; }
46 basic_block_sptr
block()
const {
return d_basic_block; }
47 int port()
const {
return d_port; }
49 bool operator==(
const endpoint &other)
const;
54 return (d_basic_block == other.d_basic_block &&
55 d_port == other.d_port);
61 basic_block_sptr d_basic_block;
68 d_basic_block = block; d_port = port; d_is_hier = is_hier;
70 basic_block_sptr
block()
const {
return d_basic_block; }
72 bool is_hier()
const {
return d_is_hier; }
81 return (d_basic_block == other.d_basic_block &&
95 edge() : d_src(), d_dst() { };
97 : d_src(src), d_dst(dst) { }
121 : d_src(src), d_dst(dst) { }
171 void connect(basic_block_sptr src_block,
int src_port,
172 basic_block_sptr dst_block,
int dst_port);
177 void disconnect(basic_block_sptr src_block,
int src_port,
178 basic_block_sptr dst_block,
int dst_port);
209 const edge_vector_t &
edges()
const {
return d_edges; }
214 const msg_edge_vector_t &
msg_edges()
const {
return d_msg_edges; }
238 std::vector<basic_block_vector_t> partition();
246 std::vector<int> calc_used_ports(basic_block_sptr
block,
bool check_inputs);
248 edge_vector_t calc_upstream_edges(basic_block_sptr
block);
249 bool has_block_p(basic_block_sptr
block);
250 edge calc_upstream_edge(basic_block_sptr
block,
int port);
255 void check_dst_not_used(
const endpoint &dst);
257 edge_vector_t calc_connections(basic_block_sptr
block,
bool check_inputs);
258 void check_contiguity(basic_block_sptr
block,
const std::vector<int> &used_ports,
bool check_inputs);
265 bool source_p(basic_block_sptr
block);
272 basic_block_sptr dst_block,
int dst_port)
280 basic_block_sptr dst_block,
int dst_port)
289 os << endp.
block()->alias() <<
":" << endp.
port();
296 os << edge.
src() <<
"->" << edge.
dst();
310 os << edge.
src() <<
"->" << edge.
dst();
const msg_edge_vector_t & msg_edges() const
Get vector of message edges.
Definition: flowgraph.h:214
endpoint()
Definition: flowgraph.h:44
boost::shared_ptr< io_signature > sptr
Definition: io_signature.h:45
std::string dot_graph_fg(flowgraph_sptr fg)
std::vector< msg_edge >::iterator msg_edge_viter_t
Definition: flowgraph.h:134
~msg_edge()
Definition: flowgraph.h:122
bool operator==(const msg_endpoint &other) const
Definition: flowgraph.h:79
msg_edge_vector_t d_msg_edges
Definition: flowgraph.h:243
msg_endpoint()
Definition: flowgraph.h:66
const msg_endpoint & dst() const
Definition: flowgraph.h:125
Class representing a directed, acyclic graph of basic blocks.
Definition: flowgraph.h:144
bool is_hier() const
Definition: flowgraph.h:72
const msg_endpoint & src() const
Definition: flowgraph.h:124
PMT_API const std::string symbol_to_string(const pmt_t &sym)
std::vector< endpoint > endpoint_vector_t
Definition: flowgraph.h:86
const edge_vector_t & edges() const
Get vector of edges.
Definition: flowgraph.h:209
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:95
int port() const
Definition: flowgraph.h:47
basic_block_sptr block() const
Definition: flowgraph.h:70
basic_block_vector_t d_blocks
Definition: flowgraph.h:241
const endpoint & dst() const
Definition: flowgraph.h:101
Include this header to use the message passing features.
Definition: logger.h:131
PMT_API bool equal(const pmt_t &x, const pmt_t &y)
edge_vector_t d_edges
Definition: flowgraph.h:242
#define PMT_NIL
Definition: pmt.h:103
std::vector< endpoint >::iterator endpoint_viter_t
Definition: flowgraph.h:87
Class representing a specific input or output graph endpoint.
Definition: flowgraph.h:37
edge(const endpoint &src, const endpoint &dst)
Definition: flowgraph.h:96
Class representing a connection between to graph endpoints.
Definition: flowgraph.h:92
endpoint(basic_block_sptr block, int port)
Definition: flowgraph.h:45
std::vector< basic_block_sptr > basic_block_vector_t
Definition: basic_block.h:394
std::ostream & operator<<(std::ostream &os, basic_block_sptr basic_block)
Definition: basic_block.h:399
std::vector< edge >::iterator edge_viter_t
Definition: flowgraph.h:110
pmt::pmt_t port() const
Definition: flowgraph.h:71
msg_endpoint(basic_block_sptr block, pmt::pmt_t port, bool is_hier=false)
Definition: flowgraph.h:67
msg_edge(const msg_endpoint &src, const msg_endpoint &dst)
Definition: flowgraph.h:120
std::vector< edge > edge_vector_t
Definition: flowgraph.h:109
Definition: flowgraph.h:58
basic_block_sptr block() const
Definition: flowgraph.h:46
void set_hier(bool h)
Definition: flowgraph.h:73
std::vector< msg_edge > msg_edge_vector_t
Definition: flowgraph.h:133
const endpoint & src() const
Definition: flowgraph.h:100
msg_edge()
Definition: flowgraph.h:119
boost::intrusive_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:56
GR_RUNTIME_API flowgraph_sptr make_flowgraph()
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:60
void disconnect(const endpoint &src, const endpoint &dst)
Disconnect two endpoints.
Class representing a msg connection between to graph msg endpoints.
Definition: flowgraph.h:116
bool operator==(const endpoint &other) const
Definition: flowgraph.h:52