1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#include "stdafx.h"
#include "CloneEnv.h"
#include "TObject.h"
namespace storm {
CloneEnv::CloneEnv() {
const Handle &h = StormInfo<TObject>::handle(engine());
MapBase *base = new (this) MapBase(h, h);
data = (Map<Object *, Object *> *)base;
}
Object *CloneEnv::cloned(Object *o) {
// It is ok if we accidentally insert an additional 'null', that will be overwritten soon
// anyway!
return data->get(o, null);
}
void CloneEnv::cloned(Object *o, Object *to) {
data->put(o, to);
}
Object *CloneEnv::get(Object *o) {
return data->get(o);
}
MAYBE(Object *) CloneEnv::at(Object *o) {
return data->get(o, null);
}
}
|