The Assimilation Project  based on Assimilation version
Go to the documentation of this file.
36 #ifndef _DISCOVERY_H
37 #define _DISCOVERY_H
38 #include <projectcommon.h>
39 #include <assimobj.h>
40 #include <netgsource.h>
41 #include <configcontext.h>
45 typedef struct _Discovery Discovery;
47 struct _Discovery {
49  char* (*instancename)(const Discovery* self);
50  void (*flushcache)(Discovery* self);
51  gboolean (*discover)(Discovery* self);
52  guint (*discoverintervalsecs) (const Discovery* self);
53  void (*sendjson)(Discovery*, char*, gsize);
55  guint64 reportcount;
56  guint64 discovercount;
58  char* _instancename;
60  guint _timerid;
63  gboolean _sentyet;
65  guint64 starttime;
66 };
68 WINEXPORT Discovery* discovery_new(const char *,NetGSource*, ConfigContext*, gsize objsize);
71 WINEXPORT void discovery_unregister(const char *);
74 #endif
79 #endif /* _DISCOVERY_H */
guint64 discovercount
How many times have we discovered something.
Definition: discovery.h:57
WINEXPORT void discovery_register(Discovery *self)
Function for registering a discovery object with the discovery infrastructure.
Definition: discovery.c:174
gboolean(* discover)(Discovery *self)
Perform the discovery.
Definition: discovery.h:51
WINEXPORT void discovery_unregister_all(void)
Unregister all discovery methods in preparation for shutting down - to make valgrind happy :-D...
Definition: discovery.c:202
char * _instancename
Timer id for repeating discovery.
Definition: discovery.h:59
Definition: projectcommon.h:45
void(* sendjson)(Discovery *, char *, gsize)
Send JSON string.
Definition: discovery.h:54
WINEXPORT Discovery * discovery_new(const char *, NetGSource *, ConfigContext *, gsize objsize)
Discovery constructor.
Definition: discovery.c:143
This file defines our base object class: AssimObj.
guint _timerid
Timer id for repeating discovery.
Definition: discovery.h:60
NetGSource * _iosource
How to send packets.
Definition: discovery.h:61
Project common header file.
Implements Configuration Context class.
WINEXPORT void discovery_unregister(const char *)
Definition: discovery.c:192
Discovery class abstract C-class - it supports discovering "things" through subclasses for different ...
Definition: discovery.h:47
guint64 starttime
When this operation was started.
Definition: discovery.h:65
guint(* discoverintervalsecs)(const Discovery *self)
How often to re-discover? (in seconds)
Definition: discovery.h:52
guint64 reportcount
How many times have we reported anything new upstream.
Definition: discovery.h:55
void(* flushcache)(Discovery *self)
Flush any cache held.
Definition: discovery.h:50
Implements NetIO GSource object.
ConfigContext * _config
Configuration Parameters - has address of CMA.
Definition: discovery.h:62
AssimObj baseclass
Base object class.
Definition: discovery.h:48
The NetGSource class objects integrate NetIO class objects into the g_main_loop paradigm.
Definition: netgsource.h:43
FSTATIC void _discovery_finalize(AssimObj *gself)
Finalizing function for Discovery objects.
Definition: discovery.c:72
gboolean _sentyet
TRUE if we&#39;ve sent this yet.
Definition: discovery.h:64