MUtilities development repository
修订版 | f903add3e120e0084767a8cf60ad4305c5aa5c4a (tree) |
---|---|
时间 | 2016-12-26 10:36:50 |
作者 | ![]() |
Commiter | LoRd_MuldeR |
Disable copy constructor.
@@ -41,7 +41,6 @@ namespace MUtils | ||
41 | 41 | class MUTILS_API Hash |
42 | 42 | { |
43 | 43 | public: |
44 | - Hash(const char* key = NULL) {}; | |
45 | 44 | virtual ~Hash(void) {}; |
46 | 45 | |
47 | 46 | bool update(const quint8 *const data, const quint32 len) { return process(data, len); } |
@@ -51,10 +50,15 @@ namespace MUtils | ||
51 | 50 | QByteArray digest(const bool bAsHex = true) { return bAsHex ? finalize().toHex() : finalize(); } |
52 | 51 | |
53 | 52 | protected: |
53 | + Hash(const char* key = NULL) {/*nothing to do*/}; | |
54 | 54 | virtual bool process(const quint8 *const data, const quint32 len) = 0; |
55 | 55 | virtual QByteArray finalize(void) = 0; |
56 | + | |
57 | + private: | |
58 | + Hash &operator=(const Hash&) { throw "Disabled"; } | |
59 | + Hash(const Hash&) { throw "Disabled"; } | |
56 | 60 | }; |
57 | 61 | |
58 | - Hash *create(const quint16 &hashId, const char *const key = NULL); | |
62 | + MUTILS_API Hash *create(const quint16 &hashId, const char *const key = NULL); | |
59 | 63 | } |
60 | 64 | } |