ArmNN
 20.02
TestProfilingConnectionTimeoutError Class Reference

#include <ProfilingTests.hpp>

Inheritance diagram for TestProfilingConnectionTimeoutError:
TestProfilingConnectionBase IProfilingConnection

Public Member Functions

 TestProfilingConnectionTimeoutError ()
 
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
 
- Public Member Functions inherited from IProfilingConnection
virtual ~IProfilingConnection ()
 

Additional Inherited Members

- Public Attributes inherited from TestProfilingConnectionBase
bool m_FirstCall = true
 

Detailed Description

Definition at line 104 of file ProfilingTests.hpp.

Constructor & Destructor Documentation

◆ TestProfilingConnectionTimeoutError()

Definition at line 107 of file ProfilingTests.hpp.

108  : m_ReadRequests(0)
109  {}

Member Function Documentation

◆ ReadCalledCount()

int ReadCalledCount ( )
inline

Definition at line 124 of file ProfilingTests.hpp.

Referenced by BOOST_AUTO_TEST_CASE().

125  {
126  return m_ReadRequests.load();
127  }

◆ ReadPacket()

Packet ReadPacket ( uint32_t  timeout)
inlineoverridevirtual

Reimplemented from TestProfilingConnectionBase.

Definition at line 111 of file ProfilingTests.hpp.

112  {
113  // Return connection acknowledged packet after three timeouts
114  if (m_ReadRequests % 3 == 0)
115  {
116  std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
117  ++m_ReadRequests;
118  throw armnn::TimeoutException("Simulate a timeout error\n");
119  }
120 
121  return Packet(65536);
122  }

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