Hi, I like to store object in a file and associate to them an hash. The hash should depends from the object content, just to have a fast check to know if two objects are equivalent or not.
The idea I thought is this:
[code]…
class MyObj : public TObject {
private:
ULong_t _id;
double val1;
double val2;
protected:
void genHash() {
_id = TString::Hash(&val1,sizeof(double)*2);
}
public:
MyObj() : val1(0), val2(0) {
genHash();
}
void set1(double v) { val1 = v; genHash(); }
void set2(double v) { val2 = v; genHash(); }
double get1() { return val1; }
double get2() { return val2; }
ULong_t getID() const{ return _id; }
ClassDef(MyObj,0)
};
…[/code]
But I like to know if there is an automatic way to produce hashes in ROOT in the way I like or other ideas.
many thanks, Guido[/code]