MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / from_node

Function from_node

example/cacheHierarchy/fkYAML/node.hpp:11560–11570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11558/// @param array An array object.
11559template <typename BasicNodeType, typename T, std::size_t N>
11560inline auto from_node(const BasicNodeType& n, T (&array)[N])
11561 -> decltype(n.get_value_inplace(std::declval<T&>()), void()) {
11562 if FK_YAML_UNLIKELY (!n.is_sequence()) {
11563 throw type_error("The target node value type is not sequence type.", n.get_type());
11564 }
11565
11566 // call get_value_inplace(), not get_value(), since the storage to fill the result into is already created.
11567 for (std::size_t i = 0; i < N; i++) {
11568 n.at(i).get_value_inplace(array[i]);
11569 }
11570}
11571
11572/// @brief from_node function for C-style 2D arrays whose element type must be a basic_node template instance type or a
11573/// compatible type.

Callers 4

node.hppFile · 0.85
operator()Method · 0.85
from_nodeMethod · 0.85
get_value_implFunction · 0.85

Calls 11

type_errorFunction · 0.85
endFunction · 0.85
exceptionFunction · 0.85
atMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected