GEN::Stream Class Reference

class Stream: General Stream More...

#include <trf_gen_v3.h>

Inheritance diagram for GEN::Stream:

AVL_tree_namespace::AVLNode< avlkey_t > GEN::StreamCBR GEN::StreamExpon GEN::StreamPareto

List of all members.

Public Member Functions

 Stream ()
virtual ~Stream ()
virtual void SetLoad (load_t)
void SetLoadRecursive (load_t load)
void Reset (void)
bytestamp_t GetArrival (void) const
burst_size_t GetBurstSize (void) const
void ExtractBurst (void)

Private Member Functions

virtual burst_size_t NextBurstSize (void)
virtual pause_size_t NextPauseSize (void)

Private Attributes

burst_size_t BurstSize
int id

Friends

class PacketGenerator


Detailed Description

class Stream: General Stream

Definition at line 127 of file trf_gen_v3.h.


Constructor & Destructor Documentation

GEN::Stream::Stream (  )  [inline]

Definition at line 145 of file trf_gen_v3.h.

00145                 : AVL::AVLNode< bytestamp_t >( 0 )
00146         {
00147             BurstSize = 0;
00148         }

virtual GEN::Stream::~Stream (  )  [inline, virtual]

Definition at line 151 of file trf_gen_v3.h.

00151 {}


Member Function Documentation

void GEN::Stream::ExtractBurst ( void   )  [inline]

Definition at line 201 of file trf_gen_v3.h.

00202         {
00203             BurstTime += BurstSize + NextPauseSize(); // Update BurstTime to point to
00204                                                       // PauseSize after the end of burst.
00205 
00206             BurstSize  = NextBurstSize();             // Get next burst size.
00207                                                       // This burst starts at BurstTime.stica’ no se declaró en este
00208 
00209 
00210         }

bytestamp_t GEN::Stream::GetArrival ( void   )  const [inline]

Definition at line 193 of file trf_gen_v3.h.

00193 { return BurstTime; }

burst_size_t GEN::Stream::GetBurstSize ( void   )  const [inline]

Definition at line 194 of file trf_gen_v3.h.

00194 { return BurstSize; }

virtual burst_size_t GEN::Stream::NextBurstSize ( void   )  [inline, private, virtual]

Reimplemented in GEN::StreamPareto, GEN::StreamExpon, and GEN::StreamCBR.

Definition at line 139 of file trf_gen_v3.h.

00139 {return 0;}

virtual pause_size_t GEN::Stream::NextPauseSize ( void   )  [inline, private, virtual]

Reimplemented in GEN::StreamPareto, GEN::StreamExpon, and GEN::StreamCBR.

Definition at line 140 of file trf_gen_v3.h.

00140 {return 0;}

void GEN::Stream::Reset ( void   )  [inline]

Definition at line 167 of file trf_gen_v3.h.

00168         {
00169 
00170 
00171             BurstSize = NextBurstSize();
00172             BurstTime = NextPauseSize() + BurstSize;
00173 
00174 
00175             // quick start: simulate start at random time during ON- or OFF-period
00176             bytestamp_t start_time = (bytestamp_t)uniform( 0, (rnd_real_t)BurstTime );
00177 
00178 
00179             if( start_time < BurstSize )  // zero time fell on ON period
00180             {
00181                 BurstSize -= (burst_size_t)start_time;
00182                 BurstTime = 0;
00183             }
00184             else  // zero time fell on OFF period
00185             {
00186                 BurstSize = NextBurstSize();
00187                 BurstTime -= start_time;
00188             }
00189 
00190         }

virtual void GEN::Stream::SetLoad ( load_t   )  [inline, virtual]

Reimplemented in GEN::StreamPareto, GEN::StreamExpon, and GEN::StreamCBR.

Definition at line 155 of file trf_gen_v3.h.

00155 {}

void GEN::Stream::SetLoadRecursive ( load_t  load  )  [inline]

Definition at line 158 of file trf_gen_v3.h.

00159         {
00160             SetLoad( load );
00161             if( LChild )  ((Stream*)LChild)->SetLoadRecursive( load );
00162 
00163             if( RChild )  ((Stream*)RChild)->SetLoadRecursive( load );
00164         }


Friends And Related Function Documentation

friend class PacketGenerator [friend]

Definition at line 132 of file trf_gen_v3.h.


Member Data Documentation

Reimplemented in GEN::StreamCBR.

Definition at line 135 of file trf_gen_v3.h.

int GEN::Stream::id [private]

Definition at line 136 of file trf_gen_v3.h.


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

Generated on Thu Nov 28 14:47:25 2013 for red_wireless by  doxygen 1.5.7.1