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

56 lines
1.1 KiB
C++
Raw Normal View History

/** Node type: Universal Data-exchange API (v2)
*
* @see https://github.com/ERIGrid2/JRA-3.1-api
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
2022-07-04 18:20:03 +02:00
* @license Apache 2.0
*********************************************************************************/
#pragma once
#include <villas/node.hpp>
#include <villas/api/universal.hpp>
#include <pthread.h>
namespace villas {
namespace node {
/* Forward declarations */
struct Sample;
class APINode : public Node {
public:
APINode(const uuid_t &id = {}, const std::string &name = "");
struct Direction {
Sample *sample;
api::universal::ChannelList channels;
pthread_cond_t cv;
pthread_mutex_t mutex;
};
// Accessed by api::universal::SignalRequest
Direction read, write;
virtual
int prepare();
virtual
int check();
protected:
virtual
int parse(json_t *json);
virtual
int _read(struct Sample *smps[], unsigned cnt);
virtual
int _write(struct Sample *smps[], unsigned cnt);
};
} // namespace node
} // namespace villas