0.6.0
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 983 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 984 of file yaml_decoders.cc.

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

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