Bobox
Public Types | Public Member Functions | Private Member Functions
bobox::box Class Reference

The interface for box implementations. More...

#include <bobox_box.hpp>

Inheritance diagram for bobox::box:
bobox::basic_box bobox::proxy_box bobox::simple_box bobox::dummy_box bobox::envelope_split_box bobox::group_box bobox::init_box bobox::rr_join_box bobox::model_box bobox::broadcast_box bobox::join_box bobox::passthrough_box bobox::rr_split_box bobox::term_box

List of all members.

Public Types

typedef std::vector< std::pair
< outarc_index_type, const box * > > 
ascendant_vector_type
 Represents the list of ascendants of the box.
typedef std::vector< std::pair
< outarc_index_type, const box * > > 
descendant_vector_type
 Represents the list of descendants of the box.

Public Member Functions

 box (box_id_type id, const box_tid_type &tid, const box_pid_type &pid, request *req)
 Constructor.
void add_input (inarc_index_type inarc, box *b, outarc_index_type outarc)
 Adds an input. This method is called during the instantiation of model.
void add_output (outarc_index_type outarc, box *b, inarc_index_type inarc)
 Adds an output. This method is called during the instantiation of model.
virtual void get_ascendants (ascendant_vector_type &ascendants) const =0
 Gets the list of ascendants of the box.
virtual void get_descendants (descendant_vector_type &descendants) const =0
 Gets the list of descendants of the box.
box_id_type get_id () const
 Gets the unique identifier of the box in the request.
virtual size_t get_inarcs_count () const =0
 Gets the count of input arcs.
virtual size_t get_outarcs_count () const =0
 Gets the count of output arcs.
const box_pid_typeget_pid () const
 Gets the pid of the box.
requestget_request () const
 Gets the request to which the box belongs and casts it.
template<class TRequest >
TRequest * get_request () const
 Gets the request to which the box belongs.
runtimeget_runtime () const
 Gets the request to which the box belongs.
template<class TRuntime >
TRuntime * get_runtime () const
 Gets the request to which the box belongs and casts it.
const box_tid_typeget_tid () const
 Gets the tid of the box.
void init ()
 Called when instantiation is completely done.
void pull_envelope (outarc_index_type outarc)
 The descendant is ready to receive another envelope.
bool push_envelope (inarc_index_type inarc, const envelope_ptr_type &env)
 This method is called by a ascendant. The method must always succeeds, however, return value determines, whether the ascendant should continue or not.

Private Member Functions

virtual void add_input_impl (inarc_index_type inarc, box *b, outarc_index_type outarc)=0
 This method is intended to be overriden. See bobox::box::add_input.
virtual void add_output_impl (outarc_index_type outarc, box *b, inarc_index_type inarc)=0
 This method is intended to be overriden. See bobox::box::add_output.
virtual void init_impl ()
 This method is intended to be overriden. See bobox::box::init.
virtual void pull_envelope_impl (outarc_index_type outarc)=0
 This method is intended to be overriden. See bobox::box::pull_envelope.
virtual bool push_envelope_impl (inarc_index_type inarc, const envelope_ptr_type &env)=0
 This method is intended to be overriden. See bobox::box::push_envelope.

Detailed Description

The interface for box implementations.


Constructor & Destructor Documentation

bobox::box::box ( box_id_type  id,
const box_tid_type tid,
const box_pid_type pid,
request req 
)

Constructor.

Parameters:
idThe identifier of the box.
tidThe box tid .
pidThe parallel identifier of the box.
reqThe request to which the box will belong.

Member Function Documentation

void bobox::box::add_input ( inarc_index_type  inarc,
box b,
outarc_index_type  outarc 
)

Adds an input. This method is called during the instantiation of model.

Parameters:
outarcThe input arc.
bThe ascendant.
inarcThe ascendant's output arc.
Remarks:
non-virtual interface
void bobox::box::add_output ( outarc_index_type  outarc,
box b,
inarc_index_type  inarc 
)

Adds an output. This method is called during the instantiation of model.

Parameters:
outarcThe output arc.
bThe descendant.
inarcThe descendant's input arc.
Remarks:
non-virtual interface
virtual void bobox::box::get_ascendants ( ascendant_vector_type ascendants) const [pure virtual]

Gets the list of ascendants of the box.

Parameters:
ascendants[out] The list of ascendants.
virtual void bobox::box::get_descendants ( descendant_vector_type descendants) const [pure virtual]

Gets the list of descendants of the box.

Parameters:
descendants[out] The list of descendants.
void bobox::box::init ( )

Called when instantiation is completely done.

Remarks:
non-virtual interface

The descendant is ready to receive another envelope.

Parameters:
outarcThe output arc.
Remarks:
non-virtual interface

This method is called by a ascendant. The method must always succeeds, however, return value determines, whether the ascendant should continue or not.

Parameters:
inarcThe input arc.
envThe envelope.
Returns:
false if the ascendant should not send another envelope (for example input buffer is full or not), true if it can continue.
Remarks:
non-virtual interface

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