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

84 lines
2.4 KiB
C++
Raw Permalink Normal View History

/** Hook list functions
*
* This file includes some examples.
*
* @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
* @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/>.
*/
/**
* @addtogroup hooks User-defined hook functions
* @ingroup path
* @{
*********************************************************************************/
#pragma once
#include <jansson.h>
/* Forward declarations */
struct vlist;
struct sample;
2020-06-08 02:25:07 +02:00
struct vpath;
2020-08-25 21:00:52 +02:00
struct vnode;
int hook_list_init(struct vlist *hs) __attribute__ ((warn_unused_result));
int hook_list_destroy(struct vlist *hs) __attribute__ ((warn_unused_result));
/** Parses an object of hooks
*
* Example:
*
* {
* stats = {
* output = "stdout"
* },
* skip_first = {
* seconds = 10
* },
* hooks = [ "print" ]
* }
*/
2021-02-16 14:15:14 +01:00
void hook_list_parse(struct vlist *hs, json_t *json, int mask, struct vpath *p, struct vnode *n);
2021-07-06 18:33:33 +02:00
void hook_list_check(struct vlist *hs);
2020-08-25 21:00:52 +02:00
void hook_list_prepare(struct vlist *hs, struct vlist *sigs, int mask, struct vpath *p, struct vnode *n);
int hook_list_prepare_signals(struct vlist *hs, struct vlist *signals);
2020-08-25 21:00:52 +02:00
int hook_list_add(struct vlist *hs, int mask, struct vpath *p, struct vnode *n);
2021-05-10 00:12:30 +02:00
int hook_list_process(struct vlist *hs, struct sample * smps[], unsigned cnt);
void hook_list_periodic(struct vlist *hs);
void hook_list_start(struct vlist *hs);
void hook_list_stop(struct vlist *hs);
struct vlist * hook_list_get_signals(struct vlist *hs);
2020-08-25 20:24:18 +02:00
/** Get the maximum number of signals which is used by any of the hooks in the list. */
unsigned hook_list_get_signals_max_cnt(struct vlist *hs);
2021-02-16 14:15:14 +01:00
json_t * hook_list_to_json(struct vlist *hs);