Functions: Support getting MFSocket based on its id
This commit is contained in:
parent
2b9d62b73a
commit
e3e42c00cb
|
@ -226,6 +226,9 @@ class MFNetwork : NonCopyable, NonMovable {
|
|||
MFNode *node_or_null_by_id(uint id);
|
||||
const MFNode *node_or_null_by_id(uint id) const;
|
||||
|
||||
MFSocket *socket_or_null_by_id(uint id);
|
||||
const MFSocket *socket_or_null_by_id(uint id) const;
|
||||
|
||||
std::string to_dot(Span<const MFNode *> marked_nodes = {}) const;
|
||||
};
|
||||
|
||||
|
@ -505,6 +508,16 @@ inline const MFNode *MFNetwork::node_or_null_by_id(uint id) const
|
|||
return node_or_null_by_id_[id];
|
||||
}
|
||||
|
||||
inline MFSocket *MFNetwork::socket_or_null_by_id(uint id)
|
||||
{
|
||||
return socket_or_null_by_id_[id];
|
||||
}
|
||||
|
||||
inline const MFSocket *MFNetwork::socket_or_null_by_id(uint id) const
|
||||
{
|
||||
return socket_or_null_by_id_[id];
|
||||
}
|
||||
|
||||
inline uint MFNetwork::socket_id_amount() const
|
||||
{
|
||||
return socket_or_null_by_id_.size();
|
||||
|
|
Loading…
Reference in New Issue