A Discrete-Event Network Simulator
API
ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker Class Reference
+ Collaboration diagram for ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker:

Public Member Functions

 ThreeGppHttpObjectTracker ()
 Creates a new instance with all counters begin at zero. More...
 
uint16_t GetNumOfObjectsReceived () const
 
bool IsEmpty () const
 
bool ObjectReceived (uint32_t &txSize, uint32_t &rxSize)
 Shall be invoked after all parts of a complete object have been received. More...
 
void ObjectSent (uint32_t size)
 Shall be invoked when a whole object has been transmitted. More...
 
void PartReceived (uint32_t size)
 Shall be invoked when an object part has been received. More...
 

Private Attributes

uint16_t m_numOfObjectsReceived
 Number of whole objects that have been received so far. More...
 
std::list< uint32_t > m_objectsSize
 Each entry is the size (in bytes) of object transmitted. More...
 
uint32_t m_rxBuffer
 The accumulated size (in bytes) of parts of a whole object. More...
 

Detailed Description

Internal:
Internal class used by ThreeGppHttpObjectTestCase. Keep track of the number of object and bytes that have been sent and received in the simulation by listening to the relevant trace sources.

Definition at line 124 of file three-gpp-http-client-server-test.cc.

Constructor & Destructor Documentation

◆ ThreeGppHttpObjectTracker()

ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker::ThreeGppHttpObjectTracker ( )

Creates a new instance with all counters begin at zero.

Definition at line 552 of file three-gpp-http-client-server-test.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ GetNumOfObjectsReceived()

uint16_t ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker::GetNumOfObjectsReceived ( ) const
Returns
Number of whole objects that have been received so far.

Definition at line 603 of file three-gpp-http-client-server-test.cc.

Referenced by ThreeGppHttpObjectTestCase::DoRun().

+ Here is the caller graph for this function:

◆ IsEmpty()

bool ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker::IsEmpty ( ) const
Returns
True if zero object is currently tracked.

Definition at line 597 of file three-gpp-http-client-server-test.cc.

Referenced by ThreeGppHttpObjectTestCase::DoRun().

+ Here is the caller graph for this function:

◆ ObjectReceived()

bool ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker::ObjectReceived ( uint32_t &  txSize,
uint32_t &  rxSize 
)

Shall be invoked after all parts of a complete object have been received.

Parameters
[out]txSizeSize of the whole object (in bytes) when it was transmitted.
[out]rxSizeSize of the whole object (in bytes) received.
Returns
True if this receive operation has a matching transmission operation (ObjectSent()), otherwise false. Both arguments are guaranteed to be replaced with initialized values if the return value is true.

Definition at line 574 of file three-gpp-http-client-server-test.cc.

References NS_LOG_FUNCTION.

Referenced by ThreeGppHttpObjectTestCase::ClientRxEmbeddedObjectCallback(), ThreeGppHttpObjectTestCase::ClientRxMainObjectCallback(), and ThreeGppHttpObjectTestCase::ServerRxCallback().

+ Here is the caller graph for this function:

◆ ObjectSent()

void ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker::ObjectSent ( uint32_t  size)

Shall be invoked when a whole object has been transmitted.

Parameters
sizeSize of the whole object (in bytes).

Definition at line 560 of file three-gpp-http-client-server-test.cc.

References NS_LOG_FUNCTION.

Referenced by ThreeGppHttpObjectTestCase::ClientTxEmbeddedObjectRequestCallback(), ThreeGppHttpObjectTestCase::ClientTxMainObjectRequestCallback(), ThreeGppHttpObjectTestCase::ServerEmbeddedObjectCallback(), and ThreeGppHttpObjectTestCase::ServerMainObjectCallback().

+ Here is the caller graph for this function:

◆ PartReceived()

void ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker::PartReceived ( uint32_t  size)

Shall be invoked when an object part has been received.

Parameters
sizeSize of the object part (in bytes). This amount will be accumulated until ObjectReceived() is invoked.

Definition at line 567 of file three-gpp-http-client-server-test.cc.

References NS_LOG_FUNCTION.

Referenced by ThreeGppHttpObjectTestCase::ClientRxEmbeddedObjectPacketCallback(), ThreeGppHttpObjectTestCase::ClientRxMainObjectPacketCallback(), and ThreeGppHttpObjectTestCase::ServerRxCallback().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_numOfObjectsReceived

uint16_t ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker::m_numOfObjectsReceived
private

Number of whole objects that have been received so far.

Definition at line 167 of file three-gpp-http-client-server-test.cc.

◆ m_objectsSize

std::list<uint32_t> ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker::m_objectsSize
private

Each entry is the size (in bytes) of object transmitted.

A new entry is pushed to the back when a new object is transmitted. The frontmost entry is then removed when a whole object is received, i.e., it's logically a first-in-first-out queue data structure.

Definition at line 163 of file three-gpp-http-client-server-test.cc.

◆ m_rxBuffer

uint32_t ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker::m_rxBuffer
private

The accumulated size (in bytes) of parts of a whole object.

Definition at line 165 of file three-gpp-http-client-server-test.cc.


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