Getter for source location zones.

This commit is contained in:
Bartosz Taudul 2018-03-18 02:35:39 +01:00
parent 9830fa297e
commit c807b3f7ef
2 changed files with 8 additions and 0 deletions

View File

@ -405,6 +405,13 @@ std::vector<int32_t> Worker::GetMatchingSourceLocation( const char* query ) cons
return match;
}
const Vector<ZoneEvent*>& Worker::GetZonesForSourceLocation( int32_t srcloc ) const
{
static const Vector<ZoneEvent*> empty;
auto it = m_data.sourceLocationZones.find( srcloc );
return it != m_data.sourceLocationZones.end() ? it->second : empty;
}
void Worker::Exec()
{
timeval tv;

View File

@ -103,6 +103,7 @@ public:
const SourceLocation& GetSourceLocation( int32_t srcloc ) const;
std::vector<int32_t> GetMatchingSourceLocation( const char* query ) const;
const Vector<ZoneEvent*>& GetZonesForSourceLocation( int32_t srcloc ) const;
NonRecursiveBenaphore& GetMbpsDataLock() { return m_mbpsData.lock; }
const std::vector<float>& GetMbpsData() const { return m_mbpsData.mbps; }