ArmNN
 22.05.01
TestProfilingConnectionBase Class Reference

#include <ProfilingTests.hpp>

Inheritance diagram for TestProfilingConnectionBase:
TestProfilingConnectionArmnnError TestProfilingConnectionBadAckPacket TestProfilingConnectionTimeoutError

Public Member Functions

 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
 

Public Attributes

bool m_FirstCall = true
 

Detailed Description

Definition at line 31 of file ProfilingTests.hpp.

Constructor & Destructor Documentation

◆ TestProfilingConnectionBase()

◆ ~TestProfilingConnectionBase()

Member Function Documentation

◆ Close()

void Close ( )
inlineoverride

Definition at line 39 of file ProfilingTests.hpp.

39 {}

◆ IsOpen()

bool IsOpen ( ) const
inlineoverride

Definition at line 37 of file ProfilingTests.hpp.

37 { return true; }

◆ ReadPacket()

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

Definition at line 48 of file ProfilingTests.hpp.

References TestProfilingConnectionBase::m_FirstCall.

49  {
50  // First time we're called return a connection ack packet. After that always timeout.
51  if (m_FirstCall)
52  {
53  m_FirstCall = false;
54  // Return connection acknowledged packet
55  return arm::pipe::Packet(65536);
56  }
57  else
58  {
59  std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
60  throw arm::pipe::TimeoutException("Simulate a timeout error\n");
61  }
62  }

◆ WritePacket()

bool WritePacket ( const unsigned char *  buffer,
uint32_t  length 
)
inlineoverride

Definition at line 41 of file ProfilingTests.hpp.

References armnn::IgnoreUnused().

42  {
43  arm::pipe::IgnoreUnused(buffer, length);
44 
45  return false;
46  }
void IgnoreUnused(Ts &&...)

Member Data Documentation

◆ m_FirstCall

bool m_FirstCall = true

Definition at line 64 of file ProfilingTests.hpp.

Referenced by TestProfilingConnectionBase::ReadPacket().


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