ArmNN
 21.11
TestProfilingConnectionBase Class Reference

#include <ProfilingTests.hpp>

Inheritance diagram for TestProfilingConnectionBase:
IProfilingConnection 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 Member Functions inherited from IProfilingConnection
virtual ~IProfilingConnection ()
 

Public Attributes

bool m_FirstCall = true
 

Detailed Description

Definition at line 70 of file ProfilingTests.hpp.

Constructor & Destructor Documentation

◆ TestProfilingConnectionBase()

◆ ~TestProfilingConnectionBase()

Member Function Documentation

◆ Close()

void Close ( )
inlineoverridevirtual

Implements IProfilingConnection.

Definition at line 78 of file ProfilingTests.hpp.

78 {}

◆ IsOpen()

bool IsOpen ( ) const
inlineoverridevirtual

Implements IProfilingConnection.

Definition at line 76 of file ProfilingTests.hpp.

76 { return true; }

◆ ReadPacket()

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

Implements IProfilingConnection.

Reimplemented in TestProfilingConnectionBadAckPacket, TestProfilingConnectionArmnnError, and TestProfilingConnectionTimeoutError.

Definition at line 87 of file ProfilingTests.hpp.

88  {
89  // First time we're called return a connection ack packet. After that always timeout.
90  if (m_FirstCall)
91  {
92  m_FirstCall = false;
93  // Return connection acknowledged packet
94  return arm::pipe::Packet(65536);
95  }
96  else
97  {
98  std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
99  throw armnn::TimeoutException("Simulate a timeout error\n");
100  }
101  }

◆ WritePacket()

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

Implements IProfilingConnection.

Definition at line 80 of file ProfilingTests.hpp.

References armnn::IgnoreUnused().

81  {
82  IgnoreUnused(buffer, length);
83 
84  return false;
85  }
void IgnoreUnused(Ts &&...)

Member Data Documentation

◆ m_FirstCall

bool m_FirstCall = true

Definition at line 103 of file ProfilingTests.hpp.


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