Main Page Modules Class Hierarchy Compound List File List Compound Members

# cSimpleChannel Class Reference

`#include <cchannel.h>`

Inheritance diagram for cSimpleChannel::

List of all members.

## Public Methods
Constructors, destructor, assignment
| cSimpleChannel (const cSimpleChannel &ch)
| cSimpleChannel (const char *name=NULL, cLinkType *l=NULL)
virtual | ~cSimpleChannel ()
cSimpleChannel& | operator= (const cSimpleChannel &msg)
Redefined cObject functions.
virtual cObject* | dup () const
virtual void | info (char *buf)
virtual void | forEach (ForeachFunc do_fn)
virtual void | writeContents (ostream &os)
virtual int | netPack ()
virtual int | netUnpack ()
Setting and getting link attributes.
virtual void | setDelay (cPar *p)
virtual void | setError (cPar *p)
virtual void | setDatarate (cPar *p)
virtual cPar* | delay () const
virtual cPar* | error () const
virtual cPar* | datarate () const
Redefined cChannel methods.
virtual cPar& | addPar (const char *s)
virtual cPar& | addPar (cPar *p)
Transmission state.
virtual bool | isBusy () const
virtual simtime_t | transmissionFinishes () const
Internally used methods.
virtual void | deliver (cMessage *msg, simtime_t at)

## Detailed Description

Channel that models delay, bit error rate and data rate.

## Constructor & Destructor Documentation

cSimpleChannel::cSimpleChannel ( | const cSimpleChannel & ch )

| Copy constructor.

cSimpleChannel::cSimpleChannel ( | const char * name = NULL,
| cLinkType * l = NULL )`[explicit]`

| Constructor.

cSimpleChannel::~cSimpleChannel ( | )`[virtual]`

| Destructor.

## Member Function Documentation

cPar & cSimpleChannel::addPar ( | cPar * p )`[virtual]`

| Redefined to specially handle "delay", "error" and "datarate". Reimplemented from cChannel.

cPar & cSimpleChannel::addPar ( | const char * s )`[virtual]`

| Redefined to specially handle "delay", "error" and "datarate". Reimplemented from cChannel.

cPar * cSimpleChannel::datarate ( | ) const`[inline, virtual]`

| Returns the data rate of the channel.

cPar * cSimpleChannel::delay ( | ) const`[inline, virtual]`

| Returns the delay of the channel.

void cSimpleChannel::deliver ( | cMessage * msg,
| simtime_t at )`[virtual]`

| Performs bit error rate, delay and transmission time modelling. Reimplemented from cChannel.

cObject * cSimpleChannel::dup ( | ) const`[inline, virtual]`

| Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cChannel.

cPar * cSimpleChannel::error ( | ) const`[inline, virtual]`

| Returns the bit error rate of the channel.

void cSimpleChannel::forEach ( | ForeachFunc do_fn )`[virtual]`

| Call the passed function for each contained object. See cObject for more details. Reimplemented from cChannel.

void cSimpleChannel::info ( | char * buf )`[virtual]`

| Produces a one-line description of object contents into the buffer passed as argument. See cObject for more details. Reimplemented from cChannel.

bool cSimpleChannel::isBusy ( | ) const`[virtual]`

| Returns whether the sender gate is currently transmitting. Transmission time of a message depends on the message length and the data rate assigned to the channel. If no data rate is assigned to the channel, the result is false.

int cSimpleChannel::netPack ( | )`[virtual]`

| Serializes the object into a PVM or MPI send buffer Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cChannel.

int cSimpleChannel::netUnpack ( | )`[virtual]`

| Deserializes the object from a PVM or MPI receive buffer Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cChannel.

cSimpleChannel & cSimpleChannel::operator= ( | const cSimpleChannel & msg )

| Assignment operator. Duplication and the assignment operator work all right with cSimpleChannel. The name member doesn't get copied; see cObject's operator=() for more details.

void cSimpleChannel::setDatarate ( | cPar * p )`[virtual]`

| Sets the data rate parameter of the channel. This affects the transmission time of messages sent through the channel. Ownership of the cPar object is handled according to the takeOwnership flag. See also: isBusy(), transmissionFinishes()

void cSimpleChannel::setDelay ( | cPar * p )`[virtual]`

| Sets the delay parameter of the channel. Ownership of the cPar object is handled according to the takeOwnership flag.

void cSimpleChannel::setError ( | cPar * p )`[virtual]`

| Sets the bit error rate parameter of the channel. When a message sent through the channel suffers at least one bit error, its bit error flag will be set. Ownership of the cPar object is handled according to the takeOwnership flag. See also: cMessage::hasBitError()

simtime_t cSimpleChannel::transmissionFinishes ( | ) const`[inline, virtual]`

| Returns the simulation time the sender gate will finish transmitting. The return value is only meaningful if isBusy() is true. Transmission time of a message depends on the message length and the data rate assigned to the channel.

void cSimpleChannel::writeContents ( | ostream & os )`[virtual]`

| Writes textual information about this object to the stream. See cObject for more details. Reimplemented from cChannel.

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

- cchannel.h