Nodes: add utility method to access bsocket

This commit is contained in:
2020-07-01 09:33:29 +02:00
parent 6c7d0aebcb
commit 8d3c4aa2d7

View File

@@ -69,6 +69,7 @@ class DSocket : NonCopyable, NonMovable {
StringRefNull name() const;
const SocketRef &socket_ref() const;
bNodeSocket *bsocket() const;
bool is_available() const;
};
@@ -111,6 +112,7 @@ class DGroupInput : NonCopyable, NonMovable {
public:
const InputSocketRef &socket_ref() const;
bNodeSocket *bsocket() const;
const DParentNode *parent() const;
Span<const DInputSocket *> linked_sockets() const;
uint id() const;
@@ -291,6 +293,11 @@ inline const SocketRef &DSocket::socket_ref() const
return *m_socket_ref;
}
inline bNodeSocket *DSocket::bsocket() const
{
return m_socket_ref->bsocket();
}
inline bool DSocket::is_available() const
{
return (m_socket_ref->bsocket()->flag & SOCK_UNAVAIL) == 0;
@@ -343,6 +350,11 @@ inline const InputSocketRef &DGroupInput::socket_ref() const
return *m_socket_ref;
}
inline bNodeSocket *DGroupInput::bsocket() const
{
return m_socket_ref->bsocket();
}
inline const DParentNode *DGroupInput::parent() const
{
return m_parent;