1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix handling of path output signals

This commit is contained in:
Manuel Pitz 2020-10-21 20:56:51 +02:00
parent af9c648e7a
commit 73dad5f73f
5 changed files with 28 additions and 24 deletions

View file

@ -192,6 +192,8 @@ char * node_name_long(struct vnode *n);
*/
struct vlist * node_output_signals(struct vnode *n);
struct vlist * node_input_signals(struct vnode *n);
/** Reverse local and remote socket address.
*
* @see node_type::reverse
@ -218,8 +220,6 @@ bool node_is_valid_name(const char *name);
bool node_is_enabled(const struct vnode *n);
struct vlist * node_get_signals(struct vnode *n, enum NodeDir dir);
json_t * node_to_json(struct vnode *);
/** @} */

View file

@ -144,6 +144,8 @@ const char * path_name(struct vpath *p);
/** Get a list of signals which is emitted by the path. */
struct vlist * path_output_signals(struct vpath *n);
struct vlist * path_signals(struct vpath *p);
/** Reverse a path */
int path_reverse(struct vpath *p, struct vpath *r);
@ -165,8 +167,6 @@ bool path_is_enabled(const struct vpath *p);
bool path_is_reversed(const struct vpath *p);
struct vlist * path_get_signals(struct vpath *p);
json_t * path_to_json(struct vpath *p);
/** @} */

View file

@ -319,7 +319,7 @@ int mapping_entry_prepare(struct mapping_entry *me, struct vlist *nodes)
end:
if (me->length < 0) {
struct vlist *sigs = node_get_signals(me->node, NodeDir::IN);
struct vlist *sigs = node_input_signals(me->node);
me->length = vlist_length(sigs);
}

View file

@ -568,14 +568,6 @@ const char * node_name_short(struct vnode *n)
return n->name;
}
struct vlist * node_output_signals(struct vnode *n)
{
if (n->output_path)
return path_output_signals(n->output_path);
return nullptr;
}
int node_reverse(struct vnode *n)
{
return node_type(n)->reverse ? node_type(n)->reverse(n) : -1;
@ -663,11 +655,17 @@ bool node_is_enabled(const struct vnode *n)
return n->enabled;
}
struct vlist * node_get_signals(struct vnode *n, enum NodeDir dir)
struct vlist * node_input_signals(struct vnode *n)
{
struct vnode_direction *nd = dir == NodeDir::IN ? &n->in : &n->out;
return node_direction_get_signals(&n->in);
}
return node_direction_get_signals(nd);
struct vlist * node_output_signals(struct vnode *n)
{
if (n->output_path)
return path_output_signals(n->output_path);
return nullptr;
}
json_t * node_to_json(struct vnode *n)

View file

@ -294,7 +294,7 @@ int path_prepare(struct vpath *p, struct vlist *nodes)
vlist_push(&p->sources, ps);
}
struct vlist *sigs = node_get_signals(me->node, NodeDir::IN);
struct vlist *sigs = node_input_signals(me->node);
/* Update signals of path */
for (unsigned j = 0; j < (unsigned) me->length; j++) {
@ -379,7 +379,7 @@ int path_prepare(struct vpath *p, struct vlist *nodes)
#endif /* WITH_HOOKS */
p->logger->info("Prepared path {} with output signals:", path_name(p));
signal_list_dump(&p->signals);
signal_list_dump(path_output_signals(p));
p->state = State::PREPARED;
@ -758,11 +758,6 @@ const char * path_name(struct vpath *p)
return p->_name;
}
struct vlist * path_output_signals(struct vpath *p)
{
return &p->signals;
}
bool path_is_simple(const struct vpath *p)
{
int ret;
@ -794,11 +789,22 @@ bool path_is_reversed(const struct vpath *p)
return p->reverse;
}
struct vlist * path_get_signals(struct vpath *p)
struct vlist * path_signals(struct vpath *p)
{
return &p->signals;
}
struct vlist * path_output_signals(struct vpath *p)
{
#ifdef WITH_HOOKS
Hook *last_hook = (Hook *) vlist_last(&p->hooks);
return last_hook->getSignals();
#else
return &p->signals;
#endif
}
json_t * path_to_json(struct vpath *p)
{
char uuid[37];