ArmNN
 22.08
TestProfilingConnectionTimeoutError Class Reference

#include <ProfilingTests.hpp>

Inheritance diagram for TestProfilingConnectionTimeoutError:
TestProfilingConnectionBase

Public Member Functions

 TestProfilingConnectionTimeoutError ()
 
arm::pipe::Packet ReadPacket (uint32_t timeout) override
 
int ReadCalledCount ()
 
- Public Member Functions inherited from TestProfilingConnectionBase
 TestProfilingConnectionBase ()=default
 
 ~TestProfilingConnectionBase ()=default
 
bool IsOpen () const override
 
void Close () override
 
bool WritePacket (const unsigned char *buffer, uint32_t length) override
 
arm::pipe::Packet ReadPacket (uint32_t timeout) override
 

Additional Inherited Members

- Public Attributes inherited from TestProfilingConnectionBase
bool m_FirstCall = true
 

Detailed Description

Definition at line 67 of file ProfilingTests.hpp.

Constructor & Destructor Documentation

◆ TestProfilingConnectionTimeoutError()

Definition at line 70 of file ProfilingTests.hpp.

71  : m_ReadRequests(0)
72  {}

Member Function Documentation

◆ ReadCalledCount()

int ReadCalledCount ( )
inline

Definition at line 87 of file ProfilingTests.hpp.

Referenced by TEST_SUITE().

88  {
89  return m_ReadRequests.load();
90  }

◆ ReadPacket()

arm::pipe::Packet ReadPacket ( uint32_t  timeout)
inlineoverride

Definition at line 74 of file ProfilingTests.hpp.

75  {
76  // Return connection acknowledged packet after three timeouts
77  if (m_ReadRequests % 3 == 0)
78  {
79  std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
80  ++m_ReadRequests;
81  throw arm::pipe::TimeoutException("Simulate a timeout error\n");
82  }
83 
84  return arm::pipe::Packet(65536);
85  }

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