Exemplo n.º 1
0
    void GraphValidator::verify_output_socket_satisfied(const GraphNode &node, const InputSocket& input_socket, ValidationResults &results) const
    {
        auto possible_connection = input_socket.connection();
        if(!possible_connection)
        {
            if(!(node.is_graph_internal_node() && input_socket.optional()))
            {
                std::string text = boost::str(boost::format("Output node %1% is missing an input connection.") % node.display_name());
                results.add(text);
                return;
            }

            if(graph_.get_input_buffer(node.name()))
                return;

            std::string text = boost::str(boost::format("Output node %1% is missing an input connection, or is missing data being set directly on the Graph.") % node.display_name());
            results.add(text);
            return;
        }

        const Connection& connection = possible_connection->get();
        const OutputSocket& output = connection.output();

        if(output.parent() == nullptr)
            throw std::logic_error("Output socket did not have a parent! Internal error!");

        verify_node_satisfied(*output.parent(), results);
    }