CoSWoT Servient-C
Loading...
Searching...
No Matches
CoSSB.h
1#ifndef COSSB_H_INCLUDED
2#define COSSB_H_INCLUDED
3
4#include <time.h>
5#include "./Queue.h"
6#include "./CoSGC.h"
7
8/*Type for function pointer to callback */
9typedef void (* func)(char *);
10
11
12/* Struct for Topics */
13
14typedef struct SubscribtionList
16 {
17 const char* topic;
22
23typedef struct TopicList
24{
28} TopicList;
29
30
31extern Queue* queue;
32
33TopicList topicList;
34// ---------------------------------------------- Functions ----------------------------------------------------
44void initCoSSB();
45
49void deleteCoSSB();
50
51
56void publish(char* rdfG);
57
63void addSubscribtion(char* topic, func callback);
64
67#endif /* COSSB_H_INCLUDED */
void addSubscribtion(char *topic, func callback)
Method used by the modules to subscribe to a topic.
Definition: CoSSB.c:25
void deleteCoSSB()
Method that frees the TopicList structure.
Definition: CoSSB.c:14
void publish(char *rdfG)
Method that publishes a graph to every subscriber, based on the topic of the graph.
Definition: CoSSB.c:50
void initCoSSB()
Method that initializes the CoSSB.
Definition: CoSSB.c:8
Definition: Queue.h:20
Definition: CoSSB.h:16
func * callBackList
Definition: CoSSB.h:19
const char * topic
Definition: CoSSB.h:17
size_t numberOfSubscribers
Definition: CoSSB.h:18
Definition: CoSSB.h:24
SubscribtionList * list
Definition: CoSSB.h:25
size_t numberOfTopics
Definition: CoSSB.h:26