ArmNN
 20.02
ProfilingGuidGenerator Class Reference

#include <ProfilingGuidGenerator.hpp>

Inheritance diagram for ProfilingGuidGenerator:
IProfilingGuidGenerator

Public Member Functions

 ProfilingGuidGenerator ()
 Construct a generator with the default address space static/dynamic partitioning. More...
 
ProfilingDynamicGuid NextGuid () override
 Return the next random Guid in the sequence. More...
 
ProfilingStaticGuid GenerateStaticId (const std::string &str) override
 Create a ProfilingStaticGuid based on a hash of the string. More...
 
- Public Member Functions inherited from IProfilingGuidGenerator
virtual ~IProfilingGuidGenerator ()
 

Detailed Description

Definition at line 18 of file ProfilingGuidGenerator.hpp.

Constructor & Destructor Documentation

◆ ProfilingGuidGenerator()

Construct a generator with the default address space static/dynamic partitioning.

Definition at line 22 of file ProfilingGuidGenerator.hpp.

22 : m_Sequence(0) {}

Member Function Documentation

◆ GenerateStaticId()

ProfilingStaticGuid GenerateStaticId ( const std::string &  str)
inlineoverridevirtual

Create a ProfilingStaticGuid based on a hash of the string.

Implements IProfilingGuidGenerator.

Definition at line 38 of file ProfilingGuidGenerator.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), and ProfilingService::GenerateStaticId().

39  {
40  uint64_t staticHash = m_Hash(str) | MIN_STATIC_GUID;
41  return ProfilingStaticGuid(staticHash);
42  }

◆ NextGuid()

ProfilingDynamicGuid NextGuid ( )
inlineoverridevirtual

Return the next random Guid in the sequence.

Implements IProfilingGuidGenerator.

Definition at line 25 of file ProfilingGuidGenerator.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), and ProfilingService::NextGuid().

26  {
27  ProfilingDynamicGuid guid(m_Sequence);
28  m_Sequence++;
29  if (m_Sequence >= MIN_STATIC_GUID)
30  {
31  // Reset the sequence to 0 when it reaches the upper bound of dynamic guid
32  m_Sequence = 0;
33  }
34  return guid;
35  }

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