Disable copy constructor.

This commit is contained in:
LoRd_MuldeR 2016-12-26 02:36:50 +01:00
parent 9fb7fcdac4
commit f903add3e1

View File

@ -41,7 +41,6 @@ namespace MUtils
class MUTILS_API Hash class MUTILS_API Hash
{ {
public: public:
Hash(const char* key = NULL) {};
virtual ~Hash(void) {}; virtual ~Hash(void) {};
bool update(const quint8 *const data, const quint32 len) { return process(data, len); } bool update(const quint8 *const data, const quint32 len) { return process(data, len); }
@ -51,10 +50,15 @@ namespace MUtils
QByteArray digest(const bool bAsHex = true) { return bAsHex ? finalize().toHex() : finalize(); } QByteArray digest(const bool bAsHex = true) { return bAsHex ? finalize().toHex() : finalize(); }
protected: protected:
Hash(const char* key = NULL) {/*nothing to do*/};
virtual bool process(const quint8 *const data, const quint32 len) = 0; virtual bool process(const quint8 *const data, const quint32 len) = 0;
virtual QByteArray finalize(void) = 0; virtual QByteArray finalize(void) = 0;
private:
Hash &operator=(const Hash&) { throw "Disabled"; }
Hash(const Hash&) { throw "Disabled"; }
}; };
Hash *create(const quint16 &hashId, const char *const key = NULL); MUTILS_API Hash *create(const quint16 &hashId, const char *const key = NULL);
} }
} }