User Manual, Developers Guide and API Documentation

wns::ldk::tools::StubBase Class Reference

Base class for Stub and PERProviderStub.

#include <ldk/tools/Stub.hpp>

Inheritance diagram for wns::ldk::tools::StubBase:

Inheritance graph
[legend]
Collaboration diagram for wns::ldk::tools::StubBase:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::deque< CompoundPtrContainerType

Public Member Functions

virtual void calculateSizes (const CommandPool *commandPool, Bit &commandPoolSize, Bit &dataSize) const
 Calculate the sizes of the PDU.
void close ()
 Disallow packets to be received.
void flush ()
 Empty the receive and sent buffer.
bool integrityCheck ()
virtual void onFUNCreated ()
 Resolve inter-FU dependencies.
void open (bool wakeup=true)
 Allow packets to be received.
void setAcceptanceSize (Bit compoundSize)
 Accept only compounds with total size smaller or equal compoundSize.
void setSizes (Bit addToPCISize, Bit addToPDUSize)
 Set PCI and PDU size offsets.
void setStepping (bool _stepping)
 Enable or disable stepping.
void step ()
 Allow one packet to be received when in stepping mode.
virtual ~StubBase ()

Public Attributes

long onFUNCreatedCalled
 Incremented each time onFUNCreated gets called.
ContainerType received
 Container storing the compounds received via doOnData.
ContainerType sent
 Container storing the compounds received via doSendData.
long wakeupCalled
 Incremented each time wakeup gets called.

Protected Member Functions

virtual bool doIsAccepting (const CompoundPtr &compound) const
virtual void doOnData (const CompoundPtr &compound)
virtual void doSendData (const CompoundPtr &sdu)
virtual void doWakeup ()
 StubBase ()

Protected Attributes

bool accepting
int addToPCISize
int addToPDUSize
int compoundAcceptanceSize
bool stepping


Detailed Description

Definition at line 82 of file Stub.hpp.


Member Typedef Documentation

Definition at line 89 of file Stub.hpp.


Constructor & Destructor Documentation

StubBase::~StubBase (  )  [virtual]

Definition at line 55 of file Stub.cpp.

StubBase::StubBase (  )  [protected]

Definition at line 38 of file Stub.cpp.


Member Function Documentation

void StubBase::calculateSizes ( const CommandPool commandPool,
Bit commandPoolSize,
Bit dataSize 
) const [virtual]

During size calculation, each FunctionalUnit is asked for the size of the PCI and SDU. Calculation begins with the layer the PDU last visited. To be able to calculate the sizes, a FunctionalUnit may in turn need to know the sizes as calculated by the FunctionalUnit right above itself.

It can do that by simply asking the CommandProxy, giving itself as questioner. The CommandProxy will then delegate the calculation request to the next higher FunctionalUnit in the path of the PDU.

Implements wns::ldk::CommandTypeSpecifierInterface.

Reimplemented in wns::ldk::tools::PERProviderStub, and wns::ldk::tools::Stub.

Definition at line 198 of file Stub.cpp.

void StubBase::close (  ) 

Definition at line 100 of file Stub.cpp.

bool StubBase::doIsAccepting ( const CompoundPtr compound  )  const [protected, virtual]

Definition at line 116 of file Stub.cpp.

void StubBase::doOnData ( const CompoundPtr compound  )  [protected, virtual]

Reimplemented in wns::ldk::tools::PERProviderStub, and wns::ldk::tools::Stub.

Definition at line 175 of file Stub.cpp.

void StubBase::doSendData ( const CompoundPtr sdu  )  [protected, virtual]

Reimplemented in wns::ldk::tools::Stub.

Definition at line 146 of file Stub.cpp.

void StubBase::doWakeup (  )  [protected, virtual]

Definition at line 190 of file Stub.cpp.

void StubBase::flush (  ) 

Definition at line 83 of file Stub.cpp.

bool StubBase::integrityCheck (  ) 

Definition at line 213 of file Stub.cpp.

void StubBase::onFUNCreated (  )  [virtual]

Often FunctionalUnits require the collaboration with other FunctionalUnits to accomplish their task. For the collaboration between FunctionalUnits we coined the term "friendship".

The onFUNCreated method is a hook being called after the complete FUN has been set up. FunctionalUnits requiring the collaboration with other FunctionalUnits should resolve these dependencies by implementing this hook accordingly.

Finding friends is usually done calling wns::ldk::fun::FUN::findFriend.

When building reconfigurable FUNs, this method may get called multiple times (e.g., after each FUN reconfiguration). Keep that in mind when allocating resources in your onFUNCreated implementation.

Reimplemented from wns::ldk::FunctionalUnit.

Definition at line 207 of file Stub.cpp.

void StubBase::open ( bool  wakeup = true  ) 

Definition at line 91 of file Stub.cpp.

void StubBase::setAcceptanceSize ( Bit  compoundSize  ) 

Definition at line 76 of file Stub.cpp.

void StubBase::setSizes ( Bit  addToPCISize,
Bit  addToPDUSize 
)

Definition at line 68 of file Stub.cpp.

void StubBase::setStepping ( bool  _stepping  ) 

Definition at line 61 of file Stub.cpp.

void StubBase::step (  ) 

Definition at line 107 of file Stub.cpp.


Member Data Documentation

Definition at line 186 of file Stub.hpp.

Definition at line 188 of file Stub.hpp.

Definition at line 189 of file Stub.hpp.

Definition at line 190 of file Stub.hpp.

Definition at line 166 of file Stub.hpp.

Definition at line 151 of file Stub.hpp.

Definition at line 156 of file Stub.hpp.

Definition at line 185 of file Stub.hpp.

Definition at line 161 of file Stub.hpp.


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

Generated on Sun May 27 03:33:00 2012 for openWNS by  doxygen 1.5.5