mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Protobuf: Remove include dependency on generated header
This allows easier reuse of ProtobufFormat. Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
parent
18cdd2a636
commit
6697e2eb72
2 changed files with 4 additions and 9 deletions
|
@ -7,13 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include <villas/format.hpp>
|
||||
|
||||
// Generated message descriptors by protoc
|
||||
#include <villas/formats/villas.pb-c.h>
|
||||
|
||||
namespace villas {
|
||||
namespace node {
|
||||
|
||||
|
@ -22,9 +17,6 @@ struct Sample;
|
|||
|
||||
class ProtobufFormat : public BinaryFormat {
|
||||
|
||||
protected:
|
||||
enum SignalType detect(const Villas__Node__Value *val);
|
||||
|
||||
public:
|
||||
using BinaryFormat::BinaryFormat;
|
||||
|
||||
|
|
|
@ -11,9 +11,12 @@
|
|||
#include <villas/signal.hpp>
|
||||
#include <villas/utils.hpp>
|
||||
|
||||
// Generated message descriptors by protoc
|
||||
#include <villas/formats/villas.pb-c.h>
|
||||
|
||||
using namespace villas::node;
|
||||
|
||||
enum SignalType ProtobufFormat::detect(const Villas__Node__Value *val) {
|
||||
static enum SignalType detect(const Villas__Node__Value *val) {
|
||||
switch (val->value_case) {
|
||||
case VILLAS__NODE__VALUE__VALUE_F:
|
||||
return SignalType::FLOAT;
|
||||
|
|
Loading…
Add table
Reference in a new issue