2017-07-06 09:37:44 +02:00
|
|
|
#ifndef SEARCHPOINTER_H
|
|
|
|
#define SEARCHPOINTER_H
|
|
|
|
|
2021-01-10 13:23:43 +01:00
|
|
|
#include "common/config.h"
|
|
|
|
|
2017-07-06 09:37:44 +02:00
|
|
|
template <class T>
|
|
|
|
class SearchPointer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SearchPointer(const T *ptr) : _ptr(ptr) {}
|
|
|
|
|
|
|
|
const T *data() const {return _ptr;}
|
|
|
|
bool operator==(const SearchPointer<T> &other) const
|
|
|
|
{return *data() == *(other.data());}
|
|
|
|
|
|
|
|
private:
|
|
|
|
const T *_ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class T>
|
2021-01-10 13:23:43 +01:00
|
|
|
inline HASH_T qHash(const SearchPointer<T> &t)
|
2017-07-06 09:37:44 +02:00
|
|
|
{
|
|
|
|
return ::qHash(*(t.data()));
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SEARCHPOINTER_H
|