Functions: Support getting MFSocket based on its id
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user