Class: MinRateQueue

Inherits:
QueueProperty show all
Defined in:
ruby/trema/packet-queue.rb

Instance Attribute Summary collapse

Attributes inherited from QueueProperty

#len, #property

Instance Method Summary collapse

Constructor Details

#initialize(property, len, rate, packet_queue) ⇒ MinRateQueue

An object that encapsulates the minimum rate queue property description.

Parameters:

  • property (Number)

    property queue id.

  • len (Number)

    length in bytes of the property queue.

  • rate (Number)

    the rate value of the mimimum rate queue.

  • packet_queue (PacketQueue)

    A PacketQueue instance to use to save the minimum rate queue.



157
158
159
160
161
162
# File 'ruby/trema/packet-queue.rb', line 157

def initialize property, len, rate, packet_queue
  super property, len
  @rate = rate
  packet_queue.append self
  Queue.append packet_queue
end

Instance Attribute Details

#rateNumber

the rate value of the minimum rate queue.

Returns:

  • (Number)

    the value of attribute rate.



145
146
147
# File 'ruby/trema/packet-queue.rb', line 145

def rate
  @rate
end

Instance Method Details

#to_sString

Returns text representation of rate prefixed by property and length attributes.

Returns:

  • (String)

    text representation of rate prefixed by property and length attributes.



167
168
169
# File 'ruby/trema/packet-queue.rb', line 167

def to_s
  super.to_s + " rate: #{rate} "
end