mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
node: add struct vnode::{sources,destinations}
This commit is contained in:
parent
13b7b6cc2f
commit
9b5b7b6947
2 changed files with 18 additions and 2 deletions
|
@ -91,8 +91,8 @@ struct vnode {
|
|||
#endif /* WITH_NETEM */
|
||||
#endif /* __linux__ */
|
||||
|
||||
struct vpath sources; /**< A list of path sources which reference this node (struct vpath_sources). */
|
||||
struct vpath destinations; /**< A list of path destinations which reference this node (struct vpath_destinations). */
|
||||
struct vlist sources; /**< A list of path sources which reference this node (struct vpath_sources). */
|
||||
struct vlist destinations; /**< A list of path destinations which reference this node (struct vpath_destinations). */
|
||||
|
||||
struct vnode_type *_vt; /**< Virtual functions (C++ OOP style) */
|
||||
void *_vd; /**< Virtual data (used by struct vnode::_vt functions) */
|
||||
|
|
16
lib/node.cpp
16
lib/node.cpp
|
@ -89,6 +89,14 @@ int node_init(struct vnode *n, struct vnode_type *vt)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = vlist_init(&n->sources);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = vlist_init(&n->destinations);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = vt->init ? vt->init(n) : 0;
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@ -392,6 +400,14 @@ int node_destroy(struct vnode *n)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = vlist_destroy(&n->sources);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = vlist_destroy(&n->destinations);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (node_type(n)->destroy) {
|
||||
ret = (int) node_type(n)->destroy(n);
|
||||
if (ret)
|
||||
|
|
Loading…
Add table
Reference in a new issue