A Discrete-Event Network Simulator
API
Public Member Functions | Private Attributes | List of all members
ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTracker Class Reference

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 122 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 550 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 601 of file three-gpp-http-client-server-test.cc.

Referenced by ThreeGppHttpObjectTestCase::DoRun().

◆ IsEmpty()

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

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

Referenced by ThreeGppHttpObjectTestCase::DoRun().

◆ 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 572 of file three-gpp-http-client-server-test.cc.

References NS_LOG_FUNCTION.

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

◆ ObjectSent()

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

◆ 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 565 of file three-gpp-http-client-server-test.cc.

References NS_LOG_FUNCTION.

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

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 165 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 161 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 163 of file three-gpp-http-client-server-test.cc.


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