diff --git a/clients/python/.gitignore b/clients/python/.gitignore index c88f87224..0d20b6487 100644 --- a/clients/python/.gitignore +++ b/clients/python/.gitignore @@ -1,4 +1 @@ *.pyc - -# Generated code by Protobuf -*_pb2.py diff --git a/clients/python/villas_pb2.py b/clients/python/villas_pb2.py new file mode 100644 index 000000000..4ba71a132 --- /dev/null +++ b/clients/python/villas_pb2.py @@ -0,0 +1,264 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: villas.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='villas.proto', + package='villas.node', + serialized_pb=_b('\n\x0cvillas.proto\x12\x0bvillas.node\"/\n\x07Message\x12$\n\x07samples\x18\x01 \x03(\x0b\x32\x13.villas.node.Sample\"\xca\x01\n\x06Sample\x12,\n\x04type\x18\x01 \x02(\x0e\x32\x18.villas.node.Sample.Type:\x04\x44\x41TA\x12\x10\n\x08sequence\x18\x02 \x01(\r\x12\n\n\x02id\x18\x03 \x01(\r\x12)\n\ttimestamp\x18\x04 \x01(\x0b\x32\x16.villas.node.Timestamp\x12\"\n\x06values\x18\x05 \x03(\x0b\x32\x12.villas.node.Value\"%\n\x04Type\x12\x08\n\x04\x44\x41TA\x10\x01\x12\t\n\x05START\x10\x02\x12\x08\n\x04STOP\x10\x03\"&\n\tTimestamp\x12\x0b\n\x03sec\x18\x01 \x02(\r\x12\x0c\n\x04nsec\x18\x02 \x02(\r\"*\n\x05Value\x12\x0b\n\x01\x66\x18\x01 \x01(\x02H\x00\x12\x0b\n\x01i\x18\x02 \x01(\x05H\x00\x42\x07\n\x05value') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_SAMPLE_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='villas.node.Sample.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DATA', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='START', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='STOP', index=2, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=244, + serialized_end=281, +) +_sym_db.RegisterEnumDescriptor(_SAMPLE_TYPE) + + +_MESSAGE = _descriptor.Descriptor( + name='Message', + full_name='villas.node.Message', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='samples', full_name='villas.node.Message.samples', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + extension_ranges=[], + oneofs=[ + ], + serialized_start=29, + serialized_end=76, +) + + +_SAMPLE = _descriptor.Descriptor( + name='Sample', + full_name='villas.node.Sample', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='villas.node.Sample.type', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=True, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='sequence', full_name='villas.node.Sample.sequence', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='id', full_name='villas.node.Sample.id', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='timestamp', full_name='villas.node.Sample.timestamp', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='values', full_name='villas.node.Sample.values', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _SAMPLE_TYPE, + ], + options=None, + is_extendable=False, + extension_ranges=[], + oneofs=[ + ], + serialized_start=79, + serialized_end=281, +) + + +_TIMESTAMP = _descriptor.Descriptor( + name='Timestamp', + full_name='villas.node.Timestamp', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='sec', full_name='villas.node.Timestamp.sec', index=0, + number=1, type=13, cpp_type=3, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='nsec', full_name='villas.node.Timestamp.nsec', index=1, + number=2, type=13, cpp_type=3, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + extension_ranges=[], + oneofs=[ + ], + serialized_start=283, + serialized_end=321, +) + + +_VALUE = _descriptor.Descriptor( + name='Value', + full_name='villas.node.Value', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='f', full_name='villas.node.Value.f', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='i', full_name='villas.node.Value.i', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='value', full_name='villas.node.Value.value', + index=0, containing_type=None, fields=[]), + ], + serialized_start=323, + serialized_end=365, +) + +_MESSAGE.fields_by_name['samples'].message_type = _SAMPLE +_SAMPLE.fields_by_name['type'].enum_type = _SAMPLE_TYPE +_SAMPLE.fields_by_name['timestamp'].message_type = _TIMESTAMP +_SAMPLE.fields_by_name['values'].message_type = _VALUE +_SAMPLE_TYPE.containing_type = _SAMPLE +_VALUE.oneofs_by_name['value'].fields.append( + _VALUE.fields_by_name['f']) +_VALUE.fields_by_name['f'].containing_oneof = _VALUE.oneofs_by_name['value'] +_VALUE.oneofs_by_name['value'].fields.append( + _VALUE.fields_by_name['i']) +_VALUE.fields_by_name['i'].containing_oneof = _VALUE.oneofs_by_name['value'] +DESCRIPTOR.message_types_by_name['Message'] = _MESSAGE +DESCRIPTOR.message_types_by_name['Sample'] = _SAMPLE +DESCRIPTOR.message_types_by_name['Timestamp'] = _TIMESTAMP +DESCRIPTOR.message_types_by_name['Value'] = _VALUE + +Message = _reflection.GeneratedProtocolMessageType('Message', (_message.Message,), dict( + DESCRIPTOR = _MESSAGE, + __module__ = 'villas_pb2' + # @@protoc_insertion_point(class_scope:villas.node.Message) + )) +_sym_db.RegisterMessage(Message) + +Sample = _reflection.GeneratedProtocolMessageType('Sample', (_message.Message,), dict( + DESCRIPTOR = _SAMPLE, + __module__ = 'villas_pb2' + # @@protoc_insertion_point(class_scope:villas.node.Sample) + )) +_sym_db.RegisterMessage(Sample) + +Timestamp = _reflection.GeneratedProtocolMessageType('Timestamp', (_message.Message,), dict( + DESCRIPTOR = _TIMESTAMP, + __module__ = 'villas_pb2' + # @@protoc_insertion_point(class_scope:villas.node.Timestamp) + )) +_sym_db.RegisterMessage(Timestamp) + +Value = _reflection.GeneratedProtocolMessageType('Value', (_message.Message,), dict( + DESCRIPTOR = _VALUE, + __module__ = 'villas_pb2' + # @@protoc_insertion_point(class_scope:villas.node.Value) + )) +_sym_db.RegisterMessage(Value) + + +# @@protoc_insertion_point(module_scope) diff --git a/lib/io/.gitignore b/lib/io/.gitignore deleted file mode 100644 index 69330092e..000000000 --- a/lib/io/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Generated code by Protobuf-c -*.pb-c.h -*.pb-c.c diff --git a/lib/io/villas.pb-c.c b/lib/io/villas.pb-c.c new file mode 100644 index 000000000..fe4850369 --- /dev/null +++ b/lib/io/villas.pb-c.c @@ -0,0 +1,442 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: lib/io/villas.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "lib/io/villas.pb-c.h" +void villas__node__message__init + (Villas__Node__Message *message) +{ + static Villas__Node__Message init_value = VILLAS__NODE__MESSAGE__INIT; + *message = init_value; +} +size_t villas__node__message__get_packed_size + (const Villas__Node__Message *message) +{ + assert(message->base.descriptor == &villas__node__message__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t villas__node__message__pack + (const Villas__Node__Message *message, + uint8_t *out) +{ + assert(message->base.descriptor == &villas__node__message__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t villas__node__message__pack_to_buffer + (const Villas__Node__Message *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &villas__node__message__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Villas__Node__Message * + villas__node__message__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Villas__Node__Message *) + protobuf_c_message_unpack (&villas__node__message__descriptor, + allocator, len, data); +} +void villas__node__message__free_unpacked + (Villas__Node__Message *message, + ProtobufCAllocator *allocator) +{ + assert(message->base.descriptor == &villas__node__message__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void villas__node__sample__init + (Villas__Node__Sample *message) +{ + static Villas__Node__Sample init_value = VILLAS__NODE__SAMPLE__INIT; + *message = init_value; +} +size_t villas__node__sample__get_packed_size + (const Villas__Node__Sample *message) +{ + assert(message->base.descriptor == &villas__node__sample__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t villas__node__sample__pack + (const Villas__Node__Sample *message, + uint8_t *out) +{ + assert(message->base.descriptor == &villas__node__sample__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t villas__node__sample__pack_to_buffer + (const Villas__Node__Sample *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &villas__node__sample__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Villas__Node__Sample * + villas__node__sample__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Villas__Node__Sample *) + protobuf_c_message_unpack (&villas__node__sample__descriptor, + allocator, len, data); +} +void villas__node__sample__free_unpacked + (Villas__Node__Sample *message, + ProtobufCAllocator *allocator) +{ + assert(message->base.descriptor == &villas__node__sample__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void villas__node__timestamp__init + (Villas__Node__Timestamp *message) +{ + static Villas__Node__Timestamp init_value = VILLAS__NODE__TIMESTAMP__INIT; + *message = init_value; +} +size_t villas__node__timestamp__get_packed_size + (const Villas__Node__Timestamp *message) +{ + assert(message->base.descriptor == &villas__node__timestamp__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t villas__node__timestamp__pack + (const Villas__Node__Timestamp *message, + uint8_t *out) +{ + assert(message->base.descriptor == &villas__node__timestamp__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t villas__node__timestamp__pack_to_buffer + (const Villas__Node__Timestamp *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &villas__node__timestamp__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Villas__Node__Timestamp * + villas__node__timestamp__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Villas__Node__Timestamp *) + protobuf_c_message_unpack (&villas__node__timestamp__descriptor, + allocator, len, data); +} +void villas__node__timestamp__free_unpacked + (Villas__Node__Timestamp *message, + ProtobufCAllocator *allocator) +{ + assert(message->base.descriptor == &villas__node__timestamp__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void villas__node__value__init + (Villas__Node__Value *message) +{ + static Villas__Node__Value init_value = VILLAS__NODE__VALUE__INIT; + *message = init_value; +} +size_t villas__node__value__get_packed_size + (const Villas__Node__Value *message) +{ + assert(message->base.descriptor == &villas__node__value__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t villas__node__value__pack + (const Villas__Node__Value *message, + uint8_t *out) +{ + assert(message->base.descriptor == &villas__node__value__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t villas__node__value__pack_to_buffer + (const Villas__Node__Value *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &villas__node__value__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Villas__Node__Value * + villas__node__value__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Villas__Node__Value *) + protobuf_c_message_unpack (&villas__node__value__descriptor, + allocator, len, data); +} +void villas__node__value__free_unpacked + (Villas__Node__Value *message, + ProtobufCAllocator *allocator) +{ + assert(message->base.descriptor == &villas__node__value__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor villas__node__message__field_descriptors[1] = +{ + { + "samples", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Villas__Node__Message, n_samples), + offsetof(Villas__Node__Message, samples), + &villas__node__sample__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned villas__node__message__field_indices_by_name[] = { + 0, /* field[0] = samples */ +}; +static const ProtobufCIntRange villas__node__message__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor villas__node__message__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "villas.node.Message", + "Message", + "Villas__Node__Message", + "villas.node", + sizeof(Villas__Node__Message), + 1, + villas__node__message__field_descriptors, + villas__node__message__field_indices_by_name, + 1, villas__node__message__number_ranges, + (ProtobufCMessageInit) villas__node__message__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCEnumValue villas__node__sample__type__enum_values_by_number[3] = +{ + { "DATA", "VILLAS__NODE__SAMPLE__TYPE__DATA", 1 }, + { "START", "VILLAS__NODE__SAMPLE__TYPE__START", 2 }, + { "STOP", "VILLAS__NODE__SAMPLE__TYPE__STOP", 3 }, +}; +static const ProtobufCIntRange villas__node__sample__type__value_ranges[] = { +{1, 0},{0, 3} +}; +static const ProtobufCEnumValueIndex villas__node__sample__type__enum_values_by_name[3] = +{ + { "DATA", 0 }, + { "START", 1 }, + { "STOP", 2 }, +}; +const ProtobufCEnumDescriptor villas__node__sample__type__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "villas.node.Sample.Type", + "Type", + "Villas__Node__Sample__Type", + "villas.node", + 3, + villas__node__sample__type__enum_values_by_number, + 3, + villas__node__sample__type__enum_values_by_name, + 1, + villas__node__sample__type__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; +static const Villas__Node__Sample__Type villas__node__sample__type__default_value = VILLAS__NODE__SAMPLE__TYPE__DATA; +static const ProtobufCFieldDescriptor villas__node__sample__field_descriptors[5] = +{ + { + "type", + 1, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_ENUM, + 0, /* quantifier_offset */ + offsetof(Villas__Node__Sample, type), + &villas__node__sample__type__descriptor, + &villas__node__sample__type__default_value, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sequence", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(Villas__Node__Sample, has_sequence), + offsetof(Villas__Node__Sample, sequence), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "id", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(Villas__Node__Sample, has_id), + offsetof(Villas__Node__Sample, id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "timestamp", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(Villas__Node__Sample, timestamp), + &villas__node__timestamp__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "values", + 5, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Villas__Node__Sample, n_values), + offsetof(Villas__Node__Sample, values), + &villas__node__value__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned villas__node__sample__field_indices_by_name[] = { + 2, /* field[2] = id */ + 1, /* field[1] = sequence */ + 3, /* field[3] = timestamp */ + 0, /* field[0] = type */ + 4, /* field[4] = values */ +}; +static const ProtobufCIntRange villas__node__sample__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor villas__node__sample__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "villas.node.Sample", + "Sample", + "Villas__Node__Sample", + "villas.node", + sizeof(Villas__Node__Sample), + 5, + villas__node__sample__field_descriptors, + villas__node__sample__field_indices_by_name, + 1, villas__node__sample__number_ranges, + (ProtobufCMessageInit) villas__node__sample__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor villas__node__timestamp__field_descriptors[2] = +{ + { + "sec", + 1, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Villas__Node__Timestamp, sec), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "nsec", + 2, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Villas__Node__Timestamp, nsec), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned villas__node__timestamp__field_indices_by_name[] = { + 1, /* field[1] = nsec */ + 0, /* field[0] = sec */ +}; +static const ProtobufCIntRange villas__node__timestamp__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor villas__node__timestamp__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "villas.node.Timestamp", + "Timestamp", + "Villas__Node__Timestamp", + "villas.node", + sizeof(Villas__Node__Timestamp), + 2, + villas__node__timestamp__field_descriptors, + villas__node__timestamp__field_indices_by_name, + 1, villas__node__timestamp__number_ranges, + (ProtobufCMessageInit) villas__node__timestamp__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor villas__node__value__field_descriptors[2] = +{ + { + "f", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_FLOAT, + offsetof(Villas__Node__Value, value_case), + offsetof(Villas__Node__Value, f), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "i", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Villas__Node__Value, value_case), + offsetof(Villas__Node__Value, i), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned villas__node__value__field_indices_by_name[] = { + 0, /* field[0] = f */ + 1, /* field[1] = i */ +}; +static const ProtobufCIntRange villas__node__value__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor villas__node__value__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "villas.node.Value", + "Value", + "Villas__Node__Value", + "villas.node", + sizeof(Villas__Node__Value), + 2, + villas__node__value__field_descriptors, + villas__node__value__field_indices_by_name, + 1, villas__node__value__number_ranges, + (ProtobufCMessageInit) villas__node__value__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/lib/io/villas.pb-c.h b/lib/io/villas.pb-c.h new file mode 100644 index 000000000..8b8f1d8de --- /dev/null +++ b/lib/io/villas.pb-c.h @@ -0,0 +1,226 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: lib/io/villas.proto */ + +#ifndef PROTOBUF_C_lib_2fio_2fvillas_2eproto__INCLUDED +#define PROTOBUF_C_lib_2fio_2fvillas_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1000000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1002001 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _Villas__Node__Message Villas__Node__Message; +typedef struct _Villas__Node__Sample Villas__Node__Sample; +typedef struct _Villas__Node__Timestamp Villas__Node__Timestamp; +typedef struct _Villas__Node__Value Villas__Node__Value; + + +/* --- enums --- */ + +typedef enum _Villas__Node__Sample__Type { + /* + * Message contains float / integer data values + */ + VILLAS__NODE__SAMPLE__TYPE__DATA = 1, + /* + * Message marks the beginning of a new simulation case + */ + VILLAS__NODE__SAMPLE__TYPE__START = 2, + /* + * Message marks the end of a simulation case + */ + VILLAS__NODE__SAMPLE__TYPE__STOP = 3 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(VILLAS__NODE__SAMPLE__TYPE) +} Villas__Node__Sample__Type; + +/* --- messages --- */ + +struct _Villas__Node__Message +{ + ProtobufCMessage base; + size_t n_samples; + Villas__Node__Sample **samples; +}; +#define VILLAS__NODE__MESSAGE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&villas__node__message__descriptor) \ + , 0,NULL } + + +struct _Villas__Node__Sample +{ + ProtobufCMessage base; + Villas__Node__Sample__Type type; + /* + * The sequence number is incremented by one for consecutive messages. + */ + protobuf_c_boolean has_sequence; + uint32_t sequence; + /* + * An id which identifies the source of this sample. + */ + protobuf_c_boolean has_id; + uint32_t id; + Villas__Node__Timestamp *timestamp; + size_t n_values; + Villas__Node__Value **values; +}; +#define VILLAS__NODE__SAMPLE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&villas__node__sample__descriptor) \ + , VILLAS__NODE__SAMPLE__TYPE__DATA, 0,0, 0,0, NULL, 0,NULL } + + +struct _Villas__Node__Timestamp +{ + ProtobufCMessage base; + /* + * Seconds since 1970-01-01 00:00:00 + */ + uint32_t sec; + /* + * Nanoseconds of the current second. + */ + uint32_t nsec; +}; +#define VILLAS__NODE__TIMESTAMP__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&villas__node__timestamp__descriptor) \ + , 0, 0 } + + +typedef enum { + VILLAS__NODE__VALUE__VALUE__NOT_SET = 0, + VILLAS__NODE__VALUE__VALUE_F = 1, + VILLAS__NODE__VALUE__VALUE_I = 2, +} Villas__Node__Value__ValueCase; + +struct _Villas__Node__Value +{ + ProtobufCMessage base; + Villas__Node__Value__ValueCase value_case; + union { + /* + * Floating point values. + */ + float f; + /* + * Integer values. + */ + int32_t i; + }; +}; +#define VILLAS__NODE__VALUE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&villas__node__value__descriptor) \ + , VILLAS__NODE__VALUE__VALUE__NOT_SET, {0} } + + +/* Villas__Node__Message methods */ +void villas__node__message__init + (Villas__Node__Message *message); +size_t villas__node__message__get_packed_size + (const Villas__Node__Message *message); +size_t villas__node__message__pack + (const Villas__Node__Message *message, + uint8_t *out); +size_t villas__node__message__pack_to_buffer + (const Villas__Node__Message *message, + ProtobufCBuffer *buffer); +Villas__Node__Message * + villas__node__message__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void villas__node__message__free_unpacked + (Villas__Node__Message *message, + ProtobufCAllocator *allocator); +/* Villas__Node__Sample methods */ +void villas__node__sample__init + (Villas__Node__Sample *message); +size_t villas__node__sample__get_packed_size + (const Villas__Node__Sample *message); +size_t villas__node__sample__pack + (const Villas__Node__Sample *message, + uint8_t *out); +size_t villas__node__sample__pack_to_buffer + (const Villas__Node__Sample *message, + ProtobufCBuffer *buffer); +Villas__Node__Sample * + villas__node__sample__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void villas__node__sample__free_unpacked + (Villas__Node__Sample *message, + ProtobufCAllocator *allocator); +/* Villas__Node__Timestamp methods */ +void villas__node__timestamp__init + (Villas__Node__Timestamp *message); +size_t villas__node__timestamp__get_packed_size + (const Villas__Node__Timestamp *message); +size_t villas__node__timestamp__pack + (const Villas__Node__Timestamp *message, + uint8_t *out); +size_t villas__node__timestamp__pack_to_buffer + (const Villas__Node__Timestamp *message, + ProtobufCBuffer *buffer); +Villas__Node__Timestamp * + villas__node__timestamp__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void villas__node__timestamp__free_unpacked + (Villas__Node__Timestamp *message, + ProtobufCAllocator *allocator); +/* Villas__Node__Value methods */ +void villas__node__value__init + (Villas__Node__Value *message); +size_t villas__node__value__get_packed_size + (const Villas__Node__Value *message); +size_t villas__node__value__pack + (const Villas__Node__Value *message, + uint8_t *out); +size_t villas__node__value__pack_to_buffer + (const Villas__Node__Value *message, + ProtobufCBuffer *buffer); +Villas__Node__Value * + villas__node__value__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void villas__node__value__free_unpacked + (Villas__Node__Value *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*Villas__Node__Message_Closure) + (const Villas__Node__Message *message, + void *closure_data); +typedef void (*Villas__Node__Sample_Closure) + (const Villas__Node__Sample *message, + void *closure_data); +typedef void (*Villas__Node__Timestamp_Closure) + (const Villas__Node__Timestamp *message, + void *closure_data); +typedef void (*Villas__Node__Value_Closure) + (const Villas__Node__Value *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor villas__node__message__descriptor; +extern const ProtobufCMessageDescriptor villas__node__sample__descriptor; +extern const ProtobufCEnumDescriptor villas__node__sample__type__descriptor; +extern const ProtobufCMessageDescriptor villas__node__timestamp__descriptor; +extern const ProtobufCMessageDescriptor villas__node__value__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_lib_2fio_2fvillas_2eproto__INCLUDED */