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

97 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.
*
* @file
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#pragma once
#include <villas/node/config.hpp>
#include <villas/node.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 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, const uuid_t sn_uuid);
/** 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 */