MCPcopy Create free account
hub / github.com/PDAL/PDAL / addOrUpdate

Function addOrUpdate

pdal/Metadata.hpp:508–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506 }
507
508 MetadataNode addOrUpdate(const std::string& lname, const double& value,
509 const std::string& descrip = std::string(), size_t precision = 10)
510 {
511 if (m_impl->nodeType(lname) == MetadataType::Array)
512 throw pdal_error("Can't call addOrUpdate() on subnode list.");
513 MetadataImplList& l = m_impl->subnodes(lname);
514
515 if (l.empty())
516 return add(lname, value, descrip, precision);
517 MetadataNodeImplPtr impl(new MetadataNodeImpl(lname));
518 impl->setValue(value, precision);
519 l.front() = impl;
520 return MetadataNode(impl);
521 }
522
523 template<typename T>
524 MetadataNode addOrUpdate(const std::string& lname, const T& value)

Callers

nothing calls this directly

Calls 6

addFunction · 0.70
MetadataNodeFunction · 0.70
emptyMethod · 0.45
setValueMethod · 0.45
nameMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected