+ return reinterpret_cast<Spell *>(
+ GetObject(Spell::TYPE_ID, ident));
+}
+
+
+void *Caster::GetObject(int typeId, const string &ident) {
+ std::map<string, LoadedExport>::const_iterator i(
+ ld.Exports().find(ident));
+ if (i != ld.Exports().end()) {
+ if (i->second.typeId != typeId) {
+ throw std::runtime_error("mismatched type for "
+ + ident);
+ } else {
+ return i->second.location;
+ }
+ }
+ return intp.GetObject(typeId, ident);