ArmNN
 20.05
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
 
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 68 of file ProfilingTests.hpp.

Constructor & Destructor Documentation

◆ TestProfilingConnectionBase()

◆ ~TestProfilingConnectionBase()

Member Function Documentation

◆ Close()

void Close ( )
inlineoverridevirtual

Implements IProfilingConnection.

Definition at line 76 of file ProfilingTests.hpp.

76 {}

◆ IsOpen()

bool IsOpen ( ) const
inlineoverridevirtual

Implements IProfilingConnection.

Definition at line 74 of file ProfilingTests.hpp.

74 { return true; }

◆ ReadPacket()

Packet ReadPacket ( uint32_t  timeout)
inlineoverridevirtual

Implements IProfilingConnection.

Reimplemented in TestProfilingConnectionBadAckPacket, TestProfilingConnectionArmnnError, and TestProfilingConnectionTimeoutError.

Definition at line 85 of file ProfilingTests.hpp.

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

◆ WritePacket()

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

Implements IProfilingConnection.

Definition at line 78 of file ProfilingTests.hpp.

References armnn::IgnoreUnused().

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

Member Data Documentation

◆ m_FirstCall

bool m_FirstCall = true

Definition at line 101 of file ProfilingTests.hpp.


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