0.6.2
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 986 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 987 of file yaml_decoders.cc.

988 {
989 assert(node.Type() == NodeType::Map || node.Type() == NodeType::Scalar);
990
991 if (node.Type() == NodeType::Scalar) {
992 // This will be default relationship hint for all arguments
993 // of this template (useful for instance for tuples)
994 rhs.default_hint = node.as<relationship_t>();
995 }
996 else {
997 for (const auto &it : node) {
998 auto key = it.first.as<std::string>();
999 if (key == "default") {
1000 rhs.default_hint = node["default"].as<relationship_t>();
1001 }
1002 else {
1003 try {
1004 auto index = stoul(key);
1005 rhs.argument_hints[index] =
1006 it.second.as<relationship_t>();
1007 }
1008 catch (std::exception &e) {
1009 return false;
1010 }
1011 }
1012 }
1013 }
1014
1015 return true;
1016 }

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