10 #include <client/include/IProfilingService.hpp>
23 if (m_Factories.find(
id) != m_Factories.end())
26 std::string(
id) +
" already registered as IBackend factory",
29 m_Factories[id] = factory;
33 if (m_ProfilingService.
has_value() && m_ProfilingService.
value().IsProfilingEnabled())
35 m_ProfilingService.
value().IncrementCounterValue(arm::pipe::REGISTERED_BACKENDS);
43 m_Factories.erase(
id);
46 if (m_ProfilingService.
has_value() && m_ProfilingService.
value().IsProfilingEnabled())
48 m_ProfilingService.
value().IncrementCounterValue(arm::pipe::UNREGISTERED_BACKENDS);
54 return (m_Factories.find(
id) != m_Factories.end());
59 auto it = m_Factories.find(
id);
60 if (it == m_Factories.end())
63 std::string(
id) +
" has no IBackend factory registered",
72 return m_Factories.size();
78 for (
const auto& it : m_Factories)
80 result.insert(it.first);
87 static const std::string delimitator =
", ";
89 std::stringstream output;
92 if (output.tellp() != std::streampos(0))
94 output << delimitator;
109 m_ProfilingService = profilingService;
114 if (m_CustomMemoryAllocatorMap.find(
id) != m_CustomMemoryAllocatorMap.end())
117 std::string(
id) +
" already has an allocator associated with it",
120 m_CustomMemoryAllocatorMap[id] = alloc;
125 m_CustomMemoryAllocatorMap.erase(
id);
130 return m_CustomMemoryAllocatorMap;
134 std::shared_ptr<IMemoryOptimizerStrategy> strategy)
136 if (m_MemoryOptimizerStrategyMap.find(
id) != m_MemoryOptimizerStrategyMap.end())
139 std::string(
id) +
" already has an memory optimizer strategy associated with it",
142 m_MemoryOptimizerStrategyMap[id] = strategy;
147 m_MemoryOptimizerStrategyMap.erase(
id);
152 return m_MemoryOptimizerStrategyMap;