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/example.hpp
Steffen Vogel 02a2aa4f94 Apply clang-format changes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00

87 lines
1.7 KiB
C++

/* An example get started with new implementations of new node-types.
*
* This example does not do any particulary useful.
* It is just a skeleton to get you started with new node-types.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <villas/node.hpp>
#include <villas/node/config.hpp>
#include <villas/timing.hpp>
namespace villas {
namespace node {
// Forward declarations
struct Sample;
class ExampleNode : public Node {
protected:
// Place any configuration and per-node state here
// Settings
int setting1;
std::string setting2;
// States
int state1;
struct timespec start_time;
virtual int _read(struct Sample *smps[], unsigned cnt);
virtual int _write(struct Sample *smps[], unsigned cnt);
public:
ExampleNode(const uuid_t &id = {}, const std::string &name = "");
/* All of the following virtual-declared functions are optional.
* Have a look at node.hpp/node.cpp for the default behaviour.
*/
virtual ~ExampleNode();
virtual int prepare();
virtual int parse(json_t *json);
// Validate node configuration
virtual int check();
virtual int start();
// virtual
// int stop();
// virtual
// int pause();
// virtual
// int resume();
// virtual
// int restart();
// virtual
// int reverse();
// virtual
// std::vector<int> getPollFDs();
// virtual
// std::vector<int> getNetemFDs();
// virtual
// struct villas::node::memory::Type * getMemoryType();
virtual const std::string &getDetails();
};
} // namespace node
} // namespace villas