#include <chainable_transmission_model.h>


Public Member Functions | |
| bool | has_next_transm_model () const throw () |
| Returns true if there is another transmission model attached to the chain. | |
| TransmissionModel & | next_transm_model_w (void) throw () |
| const TransmissionModel & | next_transm_model (void) const throw () |
Construction, destruction and lifecycle support | |
| ChainableTransmissionModel () | |
| virtual | ~ChainableTransmissionModel () |
| virtual void | init (void) throw () |
| Passes the init call to the chain. | |
| virtual void | reset (void) throw () |
| Passes the reset call to the chain. | |
Transmission model implementation | |
| virtual bool | supports_mobility (void) const throw (std::logic_error) |
| Mobility is depending on the next transmission model in the chain. | |
| virtual void | send_message (TransmissionModel::MessageInfo &mi) throw () |
| Default chaining implementiation. Just passes the message info to the next TransmissionModel if existing. | |
| virtual void | deliver_messages () throw () |
| Passes the deliver messages call to the chain. | |
Chaining stuff | |
| void | append_to_chain (TransmissionModel &) throw (std::logic_error) |
| Appends a transmission model to the chain. | |
Protected Member Functions | |
Chaining stuff | |
| void | pass_to_chain (MessageInfo &mi) |
| Passes the message further to the chain for processing (only if there is a next transmission model). | |
Messages will flow along the chain of transmission models where messages can be altered, dropped, duplicated or anything you come up with. The chain can be built from the config file using the SimulationTaskChainTransmModel task. An example configuration could be:
prepare_world edge_model=simple transm_model=stats_chain comm_model=disk_graph range=3.1 chain_transm_model name=reliableThe chain is: stats_chain -> reliable
| shawn::ChainableTransmissionModel::ChainableTransmissionModel | ( | ) |
| virtual shawn::ChainableTransmissionModel::~ChainableTransmissionModel | ( | ) | [virtual] |
| virtual void shawn::ChainableTransmissionModel::init | ( | void | ) | throw () [virtual] |
Passes the init call to the chain.
Reimplemented from shawn::TransmissionModel.
Reimplemented in shawn::RandomDropTransmissionModel, and shawn::StatsChainTransmissionModel.
| virtual void shawn::ChainableTransmissionModel::reset | ( | void | ) | throw () [virtual] |
Passes the reset call to the chain.
Reimplemented from shawn::TransmissionModel.
Reimplemented in shawn::RandomDropTransmissionModel, and shawn::StatsChainTransmissionModel.
| virtual bool shawn::ChainableTransmissionModel::supports_mobility | ( | void | ) | const throw (std::logic_error) [virtual] |
Mobility is depending on the next transmission model in the chain.
The next transmission model in the chain is asked for mobility support. Override this method to alter this behaviour. This implies that there IS a next transmission model in the chain if you use this implementation. If there is none, a std::logic_error is thrown
Implements shawn::TransmissionModel.
| virtual void shawn::ChainableTransmissionModel::send_message | ( | TransmissionModel::MessageInfo & | mi | ) | throw () [virtual] |
Default chaining implementiation. Just passes the message info to the next TransmissionModel if existing.
Override this method to implement your funtionality in the chain.
Implements shawn::TransmissionModel.
Reimplemented in shawn::RandomDropTransmissionModel, and shawn::StatsChainTransmissionModel.
| virtual void shawn::ChainableTransmissionModel::deliver_messages | ( | ) | throw () [virtual] |
Passes the deliver messages call to the chain.
Override for your own funtionality but do not forget to call ChainableTransmissionModel::deliver_messages() to pass the call on to the chain.
Implements shawn::TransmissionModel.
| void shawn::ChainableTransmissionModel::append_to_chain | ( | TransmissionModel & | ) | throw (std::logic_error) |
Appends a transmission model to the chain.
If there is no next TransmissionModel it is attached to this instance. If there is a next TransmissionModel, it is checked for chainability (instance of ChainableTransmissionModel). If it not chainable, a std::logic_error is trown. If it is chainable, the passed TransmissionModel is passed to the next ChainableTransmissionModel::append_to_chain() method.
| bool shawn::ChainableTransmissionModel::has_next_transm_model | ( | ) | const throw () |
Returns true if there is another transmission model attached to the chain.
| TransmissionModel& shawn::ChainableTransmissionModel::next_transm_model_w | ( | void | ) | throw () |
| const TransmissionModel& shawn::ChainableTransmissionModel::next_transm_model | ( | void | ) | const throw () |
| void shawn::ChainableTransmissionModel::pass_to_chain | ( | MessageInfo & | mi | ) | [protected] |
Passes the message further to the chain for processing (only if there is a next transmission model).
1.5.6