add hashing and operator== to Description
This commit is contained in:
parent
1ab596f954
commit
09ec8a252d
13
uvoscam.h
13
uvoscam.h
|
@ -37,12 +37,23 @@ class Camera
|
|||
{
|
||||
public:
|
||||
|
||||
struct Description
|
||||
class Description
|
||||
{
|
||||
public:
|
||||
std::string vendor;
|
||||
std::string serial;
|
||||
std::string id;
|
||||
std::string model;
|
||||
|
||||
size_t getHash() const
|
||||
{
|
||||
return std::hash<std::string>{}(vendor + serial + id + model);
|
||||
}
|
||||
|
||||
bool operator==(const Description& in) const
|
||||
{
|
||||
return in.getHash() == getHash();
|
||||
}
|
||||
};
|
||||
|
||||
static constexpr size_t BUFFER_DEPTH = 8;
|
||||
|
|
Loading…
Reference in a new issue