MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / DoSort

Method DoSort

WinArk/EtwView.cpp:278–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void CEtwView::DoSort(const SortInfo* si) {
279 auto compare = [&](auto& i1, auto& i2) {
280 switch (si->SortColumn)
281 {
282 case 0: return SortHelper::SortNumbers(i1->GetIndex(), i2->GetIndex(), si->SortAscending);
283 case 1: return SortHelper::SortNumbers(i1->GetTimeStamp(), i2->GetTimeStamp(), si->SortAscending);
284 case 2: return SortHelper::SortStrings(i1->GetEventName(), i2->GetEventName(), si->SortAscending);
285 case 3: return SortHelper::SortNumbers(i1->GetProcessId(), i2->GetProcessId(), si->SortAscending);
286 case 4: return SortHelper::SortStrings(i1->GetProcessName(), i2->GetProcessName(), si->SortAscending);
287 case 5: return SortHelper::SortNumbers(i1->GetThreadId(), i2->GetThreadId(), si->SortAscending);
288 case 6: return SortHelper::SortNumbers(i1->GetEventDescriptor().Opcode, i2->GetEventDescriptor().Opcode, si->SortAscending);
289 }
290 return false;
291 };
292
293 if (m_Events.size() < 20000)
294 std::sort(m_Events.begin(), m_Events.end(), compare);
295 else {
296 // C++ 17������ִ�в���
297 // std::execution::parʹ�㷨�ڶ���߳���ִ�У������̸߳��Ծ����Լ���˳�����񡣼����е���������
298 // �����ڲ���ϵͳ����ָ��һ����򰴶����첽���ٶ�ִ�У�������ʱ���ϵ��ص���ͬһ��ʱ�̷�������
299 // ������ָ����ͬһ��ʱ����ڣ�������������ִ�У���ʱ���ϵ��ص����������ͬʱ��΢��������˳��ִ�У���
300 std::sort(std::execution::par, m_Events.begin(), m_Events.end(), compare);
301 }
302}
303
304BOOL CEtwView::PreTransalteMessage(MSG* pMsg) {
305 pMsg;

Callers

nothing calls this directly

Calls 9

SortNumbersFunction · 0.85
GetIndexMethod · 0.80
GetTimeStampMethod · 0.80
GetProcessIdMethod · 0.80
GetThreadIdMethod · 0.80
GetProcessNameMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected