String adding functionality.

This commit is contained in:
Bartosz Taudul 2017-09-14 19:43:40 +02:00
parent ff07576d96
commit bbbf52eafd
2 changed files with 12 additions and 0 deletions

View File

@ -163,4 +163,14 @@ void View::CheckString( uint64_t ptr )
m_sock.Send( &ptr, sizeof( ptr ) ); m_sock.Send( &ptr, sizeof( ptr ) );
} }
void View::AddString( uint64_t ptr, std::string&& str )
{
assert( m_strings.find( ptr ) == m_strings.end( ptr ) );
auto it = m_pendingStrings.find( ptr );
assert( it != m_pendingStrings.end() );
m_pendingStrings.erase( it );
std::lock_guard<std::mutex> lock( m_lock );
m_strings.emplace( ptr, std::move( str ) );
}
} }

View File

@ -35,6 +35,7 @@ private:
void ProcessZoneEnd( uint64_t id, const QueueZoneEnd& ev ); void ProcessZoneEnd( uint64_t id, const QueueZoneEnd& ev );
void CheckString( uint64_t ptr ); void CheckString( uint64_t ptr );
void AddString( uint64_t ptr, std::string&& str );
std::string m_addr; std::string m_addr;
@ -44,6 +45,7 @@ private:
int64_t m_timeBegin; int64_t m_timeBegin;
// this block must be locked
std::mutex m_lock; std::mutex m_lock;
std::vector<Event> m_data; std::vector<Event> m_data;
std::vector<uint64_t> m_timeline; std::vector<uint64_t> m_timeline;