56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
|
#ifndef CALIBRATE_HPP
|
||
|
#define CALIBRATE_HPP
|
||
|
|
||
|
#include "generic.hpp"
|
||
|
#include "md5_wrapper.hpp"
|
||
|
|
||
|
class Calibrate : public Generic
|
||
|
{
|
||
|
public:
|
||
|
Calibrate(const std::string&, const std::string&);
|
||
|
inline static void PlusCount();
|
||
|
inline static void ClearCount();
|
||
|
inline static unsigned int GetCount();
|
||
|
inline const MD5_wrapper& GetMD5Wrapper() const;
|
||
|
bool CompareMD5(unsigned char*) const;
|
||
|
|
||
|
inline bool operator==(const Calibrate&) const;
|
||
|
inline bool operator!=(const Calibrate&) const;
|
||
|
private:
|
||
|
MD5_wrapper _md5;
|
||
|
static unsigned int _i;
|
||
|
unsigned long GetSizeByFD(const int) const;
|
||
|
};
|
||
|
|
||
|
inline void Calibrate::PlusCount()
|
||
|
{
|
||
|
_i++;
|
||
|
}
|
||
|
|
||
|
inline void Calibrate::ClearCount()
|
||
|
{
|
||
|
_i = 0;
|
||
|
}
|
||
|
|
||
|
inline unsigned int Calibrate::GetCount()
|
||
|
{
|
||
|
return _i;
|
||
|
}
|
||
|
|
||
|
inline const MD5_wrapper &Calibrate::GetMD5Wrapper() const
|
||
|
{
|
||
|
return _md5;
|
||
|
}
|
||
|
|
||
|
inline bool Calibrate::operator==(const Calibrate &rhs) const
|
||
|
{
|
||
|
return this->GetMD5Wrapper().GetString() == rhs.GetMD5Wrapper().GetString();
|
||
|
}
|
||
|
|
||
|
inline bool Calibrate::operator!=(const Calibrate &rhs) const
|
||
|
{
|
||
|
return this->GetMD5Wrapper().GetString() != rhs.GetMD5Wrapper().GetString();
|
||
|
}
|
||
|
|
||
|
#endif
|