0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
YAML::convert< relationship_hint_t > Struct Reference

Detailed Description

Definition at line 826 of file yaml_decoders.cc.

Static Public Member Functions

static bool decode (const Node &node, relationship_hint_t &rhs)
 

Member Function Documentation

◆ decode()

static bool YAML::convert< relationship_hint_t >::decode ( const Node &  node,
relationship_hint_t rhs 
)
inlinestatic

Definition at line 827 of file yaml_decoders.cc.

828 {
829 assert(node.Type() == NodeType::Map || node.Type() == NodeType::Scalar);
830
831 if (node.Type() == NodeType::Scalar) {
832 // This will be default relationship hint for all arguments
833 // of this template (useful for instance for tuples)
834 rhs.default_hint = node.as<relationship_t>();
835 }
836 else {
837 for (const auto &it : node) {
838 auto key = it.first.as<std::string>();
839 if (key == "default") {
840 rhs.default_hint = node["default"].as<relationship_t>();
841 }
842 else {
843 try {
844 auto index = stoul(key);
845 rhs.argument_hints[index] =
846 it.second.as<relationship_t>();
847 }
848 catch (std::exception &e) {
849 return false;
850 }
851 }
852 }
853 }
854
855 return true;
856 }

The documentation for this struct was generated from the following file: