Path: blob/master/modules/gapi/src/api/gapi_priv.cpp
16339 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html.3//4// Copyright (C) 2018 Intel Corporation567#include "precomp.hpp"8#include <ade/util/assert.hpp>910#include "api/gapi_priv.hpp"11#include "api/gnode_priv.hpp"1213cv::GOrigin::GOrigin(GShape s,14const cv::GNode& n,15std::size_t p,16const cv::gimpl::HostCtor c)17: shape(s), node(n), port(p), ctor(c)18{19}2021cv::GOrigin::GOrigin(GShape s, cv::gimpl::ConstVal v)22: shape(s), node(cv::GNode::Const()), value(v), port(INVALID_PORT)23{24}2526bool cv::detail::GOriginCmp::operator() (const cv::GOrigin &lhs,27const cv::GOrigin &rhs) const28{29const GNode::Priv* lhs_p = &lhs.node.priv();30const GNode::Priv* rhs_p = &rhs.node.priv();31if (lhs_p == rhs_p)32{33if (lhs.port == rhs.port)34{35// A data Origin is uniquely identified by {node/port} pair.36// The situation when there're two Origins with same {node/port}s37// but with different shapes (data formats) is illegal!38GAPI_Assert(lhs.shape == rhs.shape);39}40return lhs.port < rhs.port;41}42else return lhs_p < rhs_p;43}444546