tracy/server/TracySourceLocation.hpp

38 lines
711 B
C++
Raw Normal View History

2017-09-21 19:57:40 +00:00
#ifndef __TRACYSOURCELOCATION_HPP__
#define __TRACYSOURCELOCATION_HPP__
#include <functional>
#include <stdint.h>
#include <string.h>
namespace tracy
{
struct SourceLocation
{
uint64_t filename;
uint64_t function;
uint32_t line;
struct Hasher
{
size_t operator()( const SourceLocation& v ) const
{
const static std::hash<uint64_t> hash;
return hash( v.filename ) ^ hash( v.function ) ^ hash( v.line );
}
};
struct Comparator
{
bool operator()( const SourceLocation& lhs, const SourceLocation& rhs ) const
{
return memcmp( &lhs, &rhs, sizeof( SourceLocation ) ) == 0;
}
};
};
}
#endif