From c807b3f7efc51f448ceed898400115904acf70b5 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 18 Mar 2018 02:35:39 +0100 Subject: [PATCH] Getter for source location zones. --- server/TracyWorker.cpp | 7 +++++++ server/TracyWorker.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index f29e36fd..1856a06e 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -405,6 +405,13 @@ std::vector Worker::GetMatchingSourceLocation( const char* query ) cons return match; } +const Vector& Worker::GetZonesForSourceLocation( int32_t srcloc ) const +{ + static const Vector empty; + auto it = m_data.sourceLocationZones.find( srcloc ); + return it != m_data.sourceLocationZones.end() ? it->second : empty; +} + void Worker::Exec() { timeval tv; diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 72ad355a..687d645c 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -103,6 +103,7 @@ public: const SourceLocation& GetSourceLocation( int32_t srcloc ) const; std::vector GetMatchingSourceLocation( const char* query ) const; + const Vector& GetZonesForSourceLocation( int32_t srcloc ) const; NonRecursiveBenaphore& GetMbpsDataLock() { return m_mbpsData.lock; } const std::vector& GetMbpsData() const { return m_mbpsData.mbps; }