Functions: add debug utility for lazy function graphs
This makes it easier to print information about a socket. Just the socket name is sometimes not enough information to know where it is in the graph.
This commit is contained in:
@@ -78,6 +78,7 @@ class Socket : NonCopyable, NonMovable {
|
|||||||
const CPPType &type() const;
|
const CPPType &type() const;
|
||||||
|
|
||||||
std::string name() const;
|
std::string name() const;
|
||||||
|
std::string detailed_name() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class InputSocket : public Socket {
|
class InputSocket : public Socket {
|
||||||
|
|||||||
@@ -147,6 +147,14 @@ std::string Socket::name() const
|
|||||||
return fallback_name;
|
return fallback_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Socket::detailed_name() const
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << node_->name() << ":" << (is_input_ ? "IN" : "OUT") << ":" << index_in_node_ << ":"
|
||||||
|
<< this->name();
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
std::string Node::name() const
|
std::string Node::name() const
|
||||||
{
|
{
|
||||||
if (this->is_function()) {
|
if (this->is_function()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user