2019-02-24 09:39:41 +01:00
|
|
|
/** Message source
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
2020-01-20 17:17:00 +01:00
|
|
|
* @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
|
2019-02-24 09:39:41 +01:00
|
|
|
* @license GNU General Public License (version 3)
|
|
|
|
*
|
|
|
|
* VILLASnode
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************************/
|
|
|
|
|
|
|
|
/** A path connects one input node to multiple output nodes (1-to-n).
|
|
|
|
*
|
|
|
|
* @addtogroup path Path
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <villas/pool.h>
|
|
|
|
#include <villas/list.h>
|
|
|
|
|
|
|
|
/* Forward declarations */
|
2020-06-08 02:25:07 +02:00
|
|
|
struct vpath;
|
2019-02-24 09:39:41 +01:00
|
|
|
struct sample;
|
|
|
|
|
2020-09-10 17:36:08 +02:00
|
|
|
enum PathSourceType {
|
|
|
|
MASTER,
|
|
|
|
SECONDARY
|
|
|
|
};
|
|
|
|
|
2020-06-08 02:25:07 +02:00
|
|
|
struct vpath_source {
|
2020-08-25 21:00:52 +02:00
|
|
|
struct vnode *node;
|
2019-02-24 09:39:41 +01:00
|
|
|
|
|
|
|
bool masked;
|
2020-09-10 17:36:08 +02:00
|
|
|
|
|
|
|
enum PathSourceType type;
|
2019-02-24 09:39:41 +01:00
|
|
|
|
|
|
|
struct pool pool;
|
|
|
|
struct vlist mappings; /**< List of mappings (struct mapping_entry). */
|
2020-08-28 09:42:46 +02:00
|
|
|
struct vlist secondaries;
|
2019-02-24 09:39:41 +01:00
|
|
|
};
|
|
|
|
|
2020-09-10 17:36:08 +02:00
|
|
|
int path_source_init_master(struct vpath_source *ps, struct vnode *n) __attribute__ ((warn_unused_result));
|
|
|
|
|
|
|
|
int path_source_init_secondary(struct vpath_source *ps, struct vnode *n) __attribute__ ((warn_unused_result));
|
2019-02-24 09:39:41 +01:00
|
|
|
|
2020-09-10 17:36:08 +02:00
|
|
|
int path_source_destroy(struct vpath_source *ps) __attribute__ ((warn_unused_result));
|
2020-08-28 09:37:06 +02:00
|
|
|
|
2020-09-10 17:36:08 +02:00
|
|
|
void path_source_check(struct vpath_source *ps);
|
2019-02-24 09:39:41 +01:00
|
|
|
|
2020-06-08 02:25:07 +02:00
|
|
|
int path_source_read(struct vpath_source *ps, struct vpath *p, int i);
|
2019-02-24 09:39:41 +01:00
|
|
|
|
|
|
|
/** @} */
|