mb_mblock_impl Class Reference

The private implementation details of the mblock system. More...

#include <mb_mblock_impl.h>

List of all members.

Public Member Functions

 mb_mblock_impl (mb_runtime_base *runtime, mb_mblock *mb, const std::string &instance_name)
 ~mb_mblock_impl ()
mb_port_sptr define_port (const std::string &port_name, const std::string &protocol_class_name, bool conjugated, mb_port::port_type_t port_type)
 Define a port.
void define_component (const std::string &component_name, const std::string &class_name, pmt_t user_arg)
 Define a subcomponent by name.
void connect (const std::string &comp_name1, const std::string &port_name1, const std::string &comp_name2, const std::string &port_name2)
 connect endpoint_1 to endpoint_2
void disconnect (const std::string &comp_name1, const std::string &port_name1, const std::string &comp_name2, const std::string &port_name2)
 disconnect endpoint_1 from endpoint_2
void disconnect_component (const std::string component_name)
 disconnect all connections to specified component
void disconnect_all ()
 disconnect all connections to all components
int nconnections ()
 Return number of connections (QA mostly).
bool walk_tree (mb_visitor *visitor)
mb_msg_accepter_sptr make_accepter (pmt_t port_name)
mb_msg_queuemsgq ()
std::string instance_name () const
 Return instance name of this block.
void set_instance_name (const std::string &name)
 Set the instance name of this block.
std::string class_name () const
 Return the class name of this block.
void set_class_name (const std::string &name)
 Set the class name.
bool lookup_other_endpoint (const mb_port *port, mb_endpoint *ep)
 If bound, store endpoint from the other end of the connection.
mb_mblockmblock () const
 Return point to associated mblock.
mb_mblockmblock_parent () const
 Return pointer to the parent of our mblock.
mb_mblock_sptr component (const std::string &comp_name)
 Lookup a component by name.
mb_runtime_baseruntime ()
 Return the runtime instance.
void set_runtime (mb_runtime_base *runtime)
 Set the runtime instance.


Detailed Description

The private implementation details of the mblock system.

Constructor & Destructor Documentation

mb_mblock_impl::mb_mblock_impl ( mb_runtime_base runtime,
mb_mblock mb,
const std::string &  instance_name 
)

mb_mblock_impl::~mb_mblock_impl (  ) 


Member Function Documentation

std::string mb_mblock_impl::class_name (  )  const [inline]

Return the class name of this block.

mb_mblock_sptr mb_mblock_impl::component ( const std::string &  comp_name  ) 

Lookup a component by name.

void mb_mblock_impl::connect ( const std::string &  comp_name1,
const std::string &  port_name1,
const std::string &  comp_name2,
const std::string &  port_name2 
)

connect endpoint_1 to endpoint_2

Parameters:
comp_name1 component on one end of the connection
port_name1 the name of the port on comp1
comp_name2 component on the other end of the connection
port_name2 the name of the port on comp2
An endpoint is specified by the component's local name (given as component_name in the call to register_component) and the name of the port on that component.

To connect an internal or relay port, use "self" as the component name.

void mb_mblock_impl::define_component ( const std::string &  component_name,
const std::string &  class_name,
pmt_t  user_arg 
)

Define a subcomponent by name.

Called within the constructor to tell the system the names and identities of our sub-component mblocks.

Parameters:
component_name The name of the sub-component (must be unique with this mblock).
class_name The class of the instance that is to be created.
user_arg The argument to pass to the constructor of the component.

mb_port_sptr mb_mblock_impl::define_port ( const std::string &  port_name,
const std::string &  protocol_class_name,
bool  conjugated,
mb_port::port_type_t  port_type 
)

Define a port.

EXTERNAL and RELAY ports are part of our peer interface. INTERNAL ports are used to talk to sub-components.

Parameters:
port_name The name of the port (must be unique within this mblock).
protocol_class_name The name of the protocol class associated with this port. It must already be defined.
conjugated Are the incoming and outgoing message sets swapped?
port_type INTERNAL, EXTERNAL or RELAY.

void mb_mblock_impl::disconnect ( const std::string &  comp_name1,
const std::string &  port_name1,
const std::string &  comp_name2,
const std::string &  port_name2 
)

disconnect endpoint_1 from endpoint_2

Parameters:
comp_name1 component on one end of the connection
port_name1 the name of the port on comp1
comp_name2 component on the other end of the connection
port_name2 the name of the port on comp2
An endpoint is specified by the component's local name (given as component_name in the call to register_component) and the name of the port on that component.

To disconnect an internal or relay port, use "self" as the component name.

void mb_mblock_impl::disconnect_all (  ) 

disconnect all connections to all components

void mb_mblock_impl::disconnect_component ( const std::string  component_name  ) 

disconnect all connections to specified component

Parameters:
component_name component to disconnect

std::string mb_mblock_impl::instance_name (  )  const [inline]

Return instance name of this block.

bool mb_mblock_impl::lookup_other_endpoint ( const mb_port port,
mb_endpoint ep 
)

If bound, store endpoint from the other end of the connection.

Parameters:
port [in] port the port that we're searching for.
ep [out] the other end point from the matching connection.
Returns:
true iff there's a matching connection.

mb_msg_accepter_sptr mb_mblock_impl::make_accepter ( pmt_t  port_name  ) 

mb_mblock* mb_mblock_impl::mblock (  )  const [inline]

Return point to associated mblock.

mb_mblock* mb_mblock_impl::mblock_parent (  )  const [inline]

Return pointer to the parent of our mblock.

mb_msg_queue& mb_mblock_impl::msgq (  )  [inline]

int mb_mblock_impl::nconnections (  ) 

Return number of connections (QA mostly).

mb_runtime_base* mb_mblock_impl::runtime (  )  [inline]

Return the runtime instance.

void mb_mblock_impl::set_class_name ( const std::string &  name  ) 

Set the class name.

void mb_mblock_impl::set_instance_name ( const std::string &  name  ) 

Set the instance name of this block.

void mb_mblock_impl::set_runtime ( mb_runtime_base runtime  )  [inline]

Set the runtime instance.

bool mb_mblock_impl::walk_tree ( mb_visitor visitor  ) 


The documentation for this class was generated from the following file:

Generated on Wed Jul 29 07:20:41 2009 for GNU Radio 3.2.2 C++ API by  doxygen 1.5.8