Data Acquisition Framework
API for Tags Programming
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Modules
TagV2.h
Go to the documentation of this file.
1 
7 #ifndef _MXIDAF_TAG_NEW_H_
8 #define _MXIDAF_TAG_NEW_H_
9 
10 #include <stdint.h>
11 
12 #ifdef __cplusplus
13 extern "C"
14 {
15 #endif
16 
28 typedef struct tag_ tag;
29 
42 tag *
43  tag_new();
44 
53 void
54  tag_delete(
55  tag *self
56  );
57 
61 typedef union
62 {
63  int64_t i;
64  uint64_t u;
65  double d;
66  char * s;
67  struct {
68  char * b;
69  int l;
70  };
71 } value_t;
72 
76 typedef enum
77 {
83 } value_type_t;
84 
97 int
99  tag *self,
100  const char *equipment_name,
101  const char *tag_name,
102  value_t *value,
103  value_type_t value_type,
104  const char *unit,
105  const char *time
106  );
107 
122 int
124  tag *self,
125  const char *equipment_name,
126  const char *tag_name
127  );
128 
141 int
143  tag *self,
144  const char *equipment_name,
145  const char *tag_name
146  );
147 
157 typedef
158  void (*on_tag)(
159  tag *self,
160  const char *equipment_name,
161  const char *tag_name,
162  value_t *value,
163  value_type_t value_type,
164  const char *unit,
165  const char *time
166  );
167 
180 int
182  tag *self,
183  on_tag
184  );
185 
186 #ifdef __cplusplus
187 }
188 #endif
189 
190 #endif
int l
Definition: TagV2.h:69
int tag_publish(tag *self, const char *equipment_name, const char *tag_name, value_t *value, value_type_t value_type, const char *unit, const char *time)
Publish a tag.
void(* on_tag)(tag *self, const char *equipment_name, const char *tag_name, value_t *value, value_type_t value_type, const char *unit, const char *time)
Subscribe to callback function.
Definition: TagV2.h:158
tag * tag_new()
Create a tag.
Definition: TagV2.h:82
struct tag_ tag
Tag instance.
Definition: TagV2.h:28
uint64_t u
Definition: TagV2.h:64
int tag_subscribe_callback(tag *self, on_tag)
Set the subscribe-callback function.
Value.
Definition: TagV2.h:61
int64_t i
Definition: TagV2.h:63
double d
Definition: TagV2.h:65
char * s
Definition: TagV2.h:66
Definition: TagV2.h:80
void tag_delete(tag *self)
Delete a tag instance.
int tag_subscribe(tag *self, const char *equipment_name, const char *tag_name)
Subscribe to a tag.
Definition: TagV2.h:79
value_type_t
Tag value type.
Definition: TagV2.h:76
char * b
Definition: TagV2.h:68
Definition: TagV2.h:78
int tag_unsubscribe(tag *self, const char *equipment_name, const char *tag_name)
Unsubscribe from a tag.
Definition: TagV2.h:81