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:
parent
453e47eb42
commit
31a505d1a5
|
@ -78,6 +78,7 @@ class Socket : NonCopyable, NonMovable {
|
|||
const CPPType &type() const;
|
||||
|
||||
std::string name() const;
|
||||
std::string detailed_name() const;
|
||||
};
|
||||
|
||||
class InputSocket : public Socket {
|
||||
|
|
|
@ -147,6 +147,14 @@ std::string Socket::name() const
|
|||
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
|
||||
{
|
||||
if (this->is_function()) {
|
||||
|
|
Loading…
Reference in New Issue