ArmNN
 21.11
TestProfilingConnectionTimeoutError Class Reference

#include <ProfilingTests.hpp>

Inheritance diagram for TestProfilingConnectionTimeoutError:
TestProfilingConnectionBase IProfilingConnection

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
 
- 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 106 of file ProfilingTests.hpp.

Constructor & Destructor Documentation

◆ TestProfilingConnectionTimeoutError()

Definition at line 109 of file ProfilingTests.hpp.

110  : m_ReadRequests(0)
111  {}

Member Function Documentation

◆ ReadCalledCount()

int ReadCalledCount ( )
inline

Definition at line 126 of file ProfilingTests.hpp.

Referenced by TEST_SUITE().

127  {
128  return m_ReadRequests.load();
129  }

◆ ReadPacket()

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

Reimplemented from TestProfilingConnectionBase.

Definition at line 113 of file ProfilingTests.hpp.

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

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