INET Framework for OMNeT++/OMNEST
inet::queueing::TokenBucketClassifierMixin< T > Class Template Reference

#include <TokenBucketClassifierMixin.h>

Inheritance diagram for inet::queueing::TokenBucketClassifierMixin< T >:
inet::units::value< Value, Units >

Protected Member Functions

virtual void initialize (int stage) override
 
virtual double getNumPacketTokens (Packet *packet) const
 

Protected Attributes

double tokenConsumptionPerPacket = NaN
 
double tokenConsumptionPerBit = NaN
 

Additional Inherited Members

- Public Types inherited from inet::units::value< Value, Units >
typedef Value value_type
 
typedef Units unit
 
- Public Member Functions inherited from inet::units::value< Value, Units >
 value ()
 
 value (const value_type &v)
 
template<typename OtherValue , typename OtherUnits >
 value (const value< OtherValue, OtherUnits > &v)
 
std::string str () const
 
const value_typeget () const
 
void set (const value_type &v)
 
template<typename OtherValue , typename OtherUnits >
valueoperator= (const value< OtherValue, OtherUnits > &other)
 
template<typename OtherValue , typename OtherUnits , typename ResultValue = typename std::remove_cv<decltype(Value() + OtherValue())>::type>
value< ResultValue, Units > operator+ (const value< OtherValue, OtherUnits > &other) const
 
template<typename OtherValue , typename OtherUnits >
valueoperator+= (const value< OtherValue, OtherUnits > &other)
 
template<typename OtherValue , typename OtherUnits >
valueoperator-= (const value< OtherValue, OtherUnits > &other)
 
template<typename OtherValue , typename OtherUnits , typename ResultValue = typename std::remove_cv<decltype(Value() - OtherValue())>::type>
value< ResultValue, Units > operator- (const value< OtherValue, OtherUnits > &other) const
 
value operator- () const
 
template<typename OtherValue , typename OtherUnits , typename ResultValue = typename std::remove_cv<decltype(Value() * OtherValue())>::type>
value< ResultValue, compose< Units, OtherUnits > > operator* (const value< OtherValue, OtherUnits > &other) const
 
template<typename OtherValue >
value operator* (OtherValue v) const
 
valueoperator*= (const value_type &v)
 
template<typename OtherValue , typename OtherUnits , typename ResultValue = typename std::remove_cv<decltype(Value() / OtherValue())>::type>
value< ResultValue, compose< Units, pow< OtherUnits, -1 > > > operator/ (const value< OtherValue, OtherUnits > &other) const
 
value operator/ (const value_type &v) const
 
valueoperator/= (const value_type &v)
 
template<typename OtherValue , typename OtherUnits >
bool operator== (const value< OtherValue, OtherUnits > &other) const
 
template<typename OtherValue , typename OtherUnits >
bool operator!= (const value< OtherValue, OtherUnits > &other) const
 
template<typename OtherValue , typename OtherUnits >
bool operator< (const value< OtherValue, OtherUnits > &other) const
 
template<typename OtherValue , typename OtherUnits >
bool operator<= (const value< OtherValue, OtherUnits > &other) const
 
template<typename OtherValue , typename OtherUnits >
bool operator> (const value< OtherValue, OtherUnits > &other) const
 
template<typename OtherValue , typename OtherUnits >
bool operator>= (const value< OtherValue, OtherUnits > &other) const
 
valueoperator++ ()
 
value operator++ (int)
 
valueoperator-- ()
 
value operator-- (int)
 

Member Function Documentation

◆ getNumPacketTokens()

template<typename T >
virtual double inet::queueing::TokenBucketClassifierMixin< T >::getNumPacketTokens ( Packet packet) const
inlineprotectedvirtual
34  {
35  return b(packet->getDataLength()).get() * tokenConsumptionPerBit + tokenConsumptionPerPacket;
36  }

◆ initialize()

template<typename T >
virtual void inet::queueing::TokenBucketClassifierMixin< T >::initialize ( int  stage)
inlineoverrideprotectedvirtual

Reimplemented in inet::queueing::MultiTokenBucketClassifier, and inet::queueing::TokenBucketClassifier.

25  {
26  T::initialize(stage);
27  if (stage == INITSTAGE_LOCAL) {
28  tokenConsumptionPerPacket = T::par("tokenConsumptionPerPacket");
29  tokenConsumptionPerBit = T::par("tokenConsumptionPerBit");
30  }
31  }

Member Data Documentation

◆ tokenConsumptionPerBit

template<typename T >
double inet::queueing::TokenBucketClassifierMixin< T >::tokenConsumptionPerBit = NaN
protected

◆ tokenConsumptionPerPacket

template<typename T >
double inet::queueing::TokenBucketClassifierMixin< T >::tokenConsumptionPerPacket = NaN
protected

The documentation for this class was generated from the following file:
inet::queueing::TokenBucketClassifierMixin::tokenConsumptionPerPacket
double tokenConsumptionPerPacket
Definition: TokenBucketClassifierMixin.h:20
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
inet::queueing::TokenBucketClassifierMixin::tokenConsumptionPerBit
double tokenConsumptionPerBit
Definition: TokenBucketClassifierMixin.h:21