27 #include "../entity/profiler/ProfilerMemorySnapshot.h"
33 PersistentEntitySegment(entityCollection,
ic, useMongoIds),
34 PersistentProfilerDataSegmentBase()
39 ProfilerEntityBaseList PersistentProfilerDataSegment::getProfilerDataEntities(
const Ice::Current&)
const
41 ProfilerEntityBaseList entities;
43 for (
const auto& entity : getAllEntities())
45 if (entity->ice_isA(ProfilerEntityBase::ice_staticId()))
47 entities.push_back(ProfilerEntityBasePtr::dynamicCast(entity));
57 ProfilerEventBaseList entities;
61 if (entity->ice_isA(ProfilerEventBase::ice_staticId()))
63 entities.push_back(ProfilerEventBasePtr::dynamicCast(entity));
72 ProfilerTransitionBaseList entities;
74 for (
const auto& entity : getAllEntities())
76 if (entity->ice_isA(ProfilerTransitionBase::ice_staticId()))
78 entities.push_back(ProfilerTransitionBasePtr::dynamicCast(entity));
86 ProfilerMemorySnapshotBaseList entities;
90 if (entity->ice_isA(ProfilerMemorySnapshotBase::ice_staticId()))
92 entities.push_back(ProfilerMemorySnapshotBasePtr::dynamicCast(entity));
101 ProfilerProcessBaseList entities;
105 if (entity->ice_isA(ProfilerProcessBase::ice_staticId()))
107 entities.push_back(ProfilerProcessBasePtr::dynamicCast(entity));
116 ProfilerMemoryUsageBaseList entities;
120 if (entity->ice_isA(ProfilerMemoryUsageBase::ice_staticId()))
122 entities.push_back(ProfilerMemoryUsageBasePtr::dynamicCast(entity));
134 std::string entityId = PersistentProfilerDataSegment::GetEntityIdFromList<EntityBasePtr>(memorySnapshot, entities);
136 if (entityId.empty())
148 std::string entityId = PersistentProfilerDataSegment::GetEntityIdFromList<ProfilerTransitionBasePtr>(transition, transitionEntities);
149 if (entityId.empty())
157 ProfilerTransitionBasePtr entity = ProfilerTransitionBasePtr::dynamicCast(
getEntityById(entityId));
158 entity->setCount(entity->getCount() + 1);
168 std::string entityId(
"");
169 if (entities.empty())
174 auto entityIterator = std::find_if(entities.begin(), entities.end(), [&entity](EntityBasePtr current)
176 return entity->equalsAttributes(current);
178 if (entityIterator != entities.end())
180 entityId = (*entityIterator)->getId();