root/src/bundle.pb-c.h

Revision 3081176b656a255da1e587a44933eabc58ee9119, 3.0 kB (checked in by Dan Di Spaltro <dan@cloudkick.com>, 3 years ago)

Add autodetection of the libprotobuf-c library
Add the generated bundle file
use preprocessor macros to compile out support of protobufs.
Add 'B' metrics with the discussed format over IRC, enough information to route,
while preserving the cross language decoding.

  • Property mode set to 100644
Line 
1 /* Generated by the protocol buffer compiler.  DO NOT EDIT! */
2
3 #ifndef PROTOBUF_C_bundle_2eproto__INCLUDED
4 #define PROTOBUF_C_bundle_2eproto__INCLUDED
5
6 #include <google/protobuf-c/protobuf-c.h>
7
8 PROTOBUF_C_BEGIN_DECLS
9
10
11 typedef struct _Metric Metric;
12 typedef struct _Bundle Bundle;
13
14
15 /* --- enums --- */
16
17
18 /* --- messages --- */
19
20 struct  _Metric
21 {
22   ProtobufCMessage base;
23   char *name;
24   int32_t metrictype;
25   protobuf_c_boolean has_valuedbl;
26   double valuedbl;
27   protobuf_c_boolean has_valuei64;
28   int64_t valuei64;
29   protobuf_c_boolean has_valueui64;
30   uint64_t valueui64;
31   protobuf_c_boolean has_valuei32;
32   int32_t valuei32;
33   protobuf_c_boolean has_valueui32;
34   uint32_t valueui32;
35   char *valuestr;
36 };
37 #define METRIC__INIT \
38  { PROTOBUF_C_MESSAGE_INIT (&metric__descriptor) \
39     , NULL, 0, 0,0, 0,0, 0,0, 0,0, 0,0, NULL }
40
41
42 struct  _Bundle
43 {
44   ProtobufCMessage base;
45   int32_t available;
46   int32_t state;
47   int32_t duration;
48   char *status;
49   size_t n_metrics;
50   Metric **metrics;
51 };
52 #define BUNDLE__INIT \
53  { PROTOBUF_C_MESSAGE_INIT (&bundle__descriptor) \
54     , 0, 0, 0, NULL, 0,NULL }
55
56
57 /* Metric methods */
58 void   metric__init
59                      (Metric         *message);
60 size_t metric__get_packed_size
61                      (const Metric   *message);
62 size_t metric__pack
63                      (const Metric   *message,
64                       uint8_t             *out);
65 size_t metric__pack_to_buffer
66                      (const Metric   *message,
67                       ProtobufCBuffer     *buffer);
68 Metric *
69        metric__unpack
70                      (ProtobufCAllocator  *allocator,
71                       size_t               len,
72                       const uint8_t       *data);
73 void   metric__free_unpacked
74                      (Metric *message,
75                       ProtobufCAllocator *allocator);
76 /* Bundle methods */
77 void   bundle__init
78                      (Bundle         *message);
79 size_t bundle__get_packed_size
80                      (const Bundle   *message);
81 size_t bundle__pack
82                      (const Bundle   *message,
83                       uint8_t             *out);
84 size_t bundle__pack_to_buffer
85                      (const Bundle   *message,
86                       ProtobufCBuffer     *buffer);
87 Bundle *
88        bundle__unpack
89                      (ProtobufCAllocator  *allocator,
90                       size_t               len,
91                       const uint8_t       *data);
92 void   bundle__free_unpacked
93                      (Bundle *message,
94                       ProtobufCAllocator *allocator);
95 /* --- per-message closures --- */
96
97 typedef void (*Metric_Closure)
98                  (const Metric *message,
99                   void *closure_data);
100 typedef void (*Bundle_Closure)
101                  (const Bundle *message,
102                   void *closure_data);
103
104 /* --- services --- */
105
106
107 /* --- descriptors --- */
108
109 extern const ProtobufCMessageDescriptor metric__descriptor;
110 extern const ProtobufCMessageDescriptor bundle__descriptor;
111
112 PROTOBUF_C_END_DECLS
113
114
115 #endif  /* PROTOBUF_bundle_2eproto__INCLUDED */
Note: See TracBrowser for help on using the browser.