• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include "ProfilingStateMachine.hpp"
9 #include "SendTimelinePacket.hpp"
10 #include "INotifyBackends.hpp"
11 
12 #include <client/include/IReportStructure.hpp>
13 
14 #include <common/include/CommandHandlerFunctor.hpp>
15 #include <common/include/Optional.hpp>
16 #include <common/include/Packet.hpp>
17 
18 namespace arm
19 {
20 
21 namespace pipe
22 {
23 
24 class ActivateTimelineReportingCommandHandler : public arm::pipe::CommandHandlerFunctor
25 {
26 public:
ActivateTimelineReportingCommandHandler(uint32_t familyId,uint32_t packetId,uint32_t version,SendTimelinePacket & sendTimelinePacket,ProfilingStateMachine & profilingStateMachine,arm::pipe::Optional<IReportStructure &> reportStructure,std::atomic<bool> & timelineReporting,INotifyBackends & notifyBackends,IProfilingService & profilingService)27     ActivateTimelineReportingCommandHandler(uint32_t familyId,
28                                             uint32_t packetId,
29                                             uint32_t version,
30                                             SendTimelinePacket& sendTimelinePacket,
31                                             ProfilingStateMachine& profilingStateMachine,
32                                             arm::pipe::Optional<IReportStructure&> reportStructure,
33                                             std::atomic<bool>& timelineReporting,
34                                             INotifyBackends& notifyBackends,
35                                             IProfilingService& profilingService)
36         : CommandHandlerFunctor(familyId, packetId, version),
37           m_SendTimelinePacket(sendTimelinePacket),
38           m_StateMachine(profilingStateMachine),
39           m_TimelineReporting(timelineReporting),
40           m_BackendNotifier(notifyBackends),
41           m_ProfilingService(profilingService),
42           m_ReportStructure(reportStructure)
43     {}
44 
45     void operator()(const arm::pipe::Packet& packet) override;
46 
47 private:
48     SendTimelinePacket&    m_SendTimelinePacket;
49     ProfilingStateMachine& m_StateMachine;
50     std::atomic<bool>&     m_TimelineReporting;
51     INotifyBackends&       m_BackendNotifier;
52     IProfilingService&     m_ProfilingService;
53 
54     arm::pipe::Optional<IReportStructure&> m_ReportStructure;
55 };
56 
57 } // namespace pipe
58 
59 } // namespace arm
60