MCPcopy Create free account
hub / github.com/bab2min/tomotopy / getMultiMetadata

Method getMultiMetadata

src/python/handler/py_DMR.cpp:219–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219py::UniqueObj DocumentObject::getMultiMetadata() const
220{
221 if (!doc) throw py::RuntimeError{ "doc is null!" };
222 auto inst = corpus->tm->getInst<tomoto::IDMRModel>();
223
224 if(auto ret = docVisit<tomoto::DocumentDMR>(getBoundDoc(), [&](auto* doc)
225 {
226 return py::buildPyValueTransform(doc->multiMetadata.begin(), doc->multiMetadata.end(), [&](uint64_t x)
227 {
228 return inst->getMultiMetadataDict().toWord(x);
229 });
230 })) return ret;
231 throw py::AttributeError{ "doc has no `multi_metadata` field!" };
232}

Callers

nothing calls this directly

Calls 4

buildPyValueTransformFunction · 0.85
getMultiMetadataDictMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected