MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / get_attr

Method get_attr

include/chaiscript/dispatchkit/boxed_value.hpp:321–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319 }
320
321 Boxed_Value get_attr(const std::string &t_name)
322 {
323 if (!m_data->m_attrs)
324 {
325 m_data->m_attrs = std::make_unique<std::map<std::string, std::shared_ptr<Data>>>();
326 }
327
328 auto &attr = (*m_data->m_attrs)[t_name];
329 if (attr) {
330 return Boxed_Value(attr, Internal_Construction());
331 } else {
332 Boxed_Value bv; //default construct a new one
333 attr = bv.m_data;
334 return bv;
335 }
336 }
337
338 Boxed_Value &copy_attrs(const Boxed_Value &t_obj)
339 {

Callers 2

compiled_tests.cppFile · 0.80
eval_internalMethod · 0.80

Calls 2

Boxed_ValueClass · 0.70

Tested by

no test coverage detected