7#ifndef ngcdcsPUBLISHER_H
8#define ngcdcsPUBLISHER_H
12#error This is a C++ include file and cannot be used from plain C
20#define ngcdcsPUB_POSTPONE 0x1
21#define ngcdcsPUB_KEEP 0x2
40 for (l=other.list_.
First();l!=NULL;l=l->
next)
53 for (l=other.list_.
First();l!=NULL;l=l->
next)
72 if (topic != NULL)
delete topic;
86 if (strcmp(topic->
id,
id) == 0)
88 list_.Remove(topic);
delete topic;
101 sprintf(s,
"%d",
id);
107 if (strcmp(topic.
status,
"Active") == 0)
119 PublishList_(topic.
id, topic.
status);
122 else if (strlen(topic.
fileName) > 0)
128 PublishList_(topic.
id, topic.
status);
131 else if (strlen(topic.
status) > 0)
136 PublishList_(topic.
id, topic.
status);
153 fprintf(stdout,
"data: %s,%s,%s:%s\n", topic.
id, topic.
status,
163 void PublishList_(
const char *
id,
const char *status) {
165 for (l = list_.
First(); l != NULL; l = l->
next)
170 if (strcmp(topic->
id,
id) == 0)
175 strcpy(topic->
status, status);
Definition ngcbLIST.hpp:33
void * item
Item.
Definition ngcbLIST.hpp:36
void Clear()
Clear list.
Definition ngcbLIST.cpp:39
ngcbLIST * First() const
Return list entry point.
Definition ngcbLIST.cpp:31
ngcbLIST * next
Next item.
Definition ngcbLIST.hpp:39
ngcdcsPUBLISHER & operator=(const ngcdcsPUBLISHER &other)
Operator =.
Definition ngcdcsPUBLISHER.hpp:36
int logLevel
Logging level.
Definition ngcdcsPUBLISHER.hpp:33
int verboseLevel
Verbose level.
Definition ngcdcsPUBLISHER.hpp:30
ngcdcsPUBLISHER(const ngcdcsPUBLISHER &other)
Copy constructor.
Definition ngcdcsPUBLISHER.hpp:49
void Remove(int id)
Remove all topics marked with an id from publisher list.
Definition ngcdcsPUBLISHER.hpp:99
ngcdcsPUBLISHER()
Constructor.
Definition ngcdcsPUBLISHER.hpp:61
void Clear()
Clear publisher list.
Definition ngcdcsPUBLISHER.hpp:67
void Push(const ngcdcs_exp_topic &topic)
Push topic to publisher.
Definition ngcdcsPUBLISHER.hpp:106
virtual ~ngcdcsPUBLISHER()
Destructor.
Definition ngcdcsPUBLISHER.hpp:64
virtual void Publish(const ngcdcs_exp_topic &topic)
Publisher.
Definition ngcdcsPUBLISHER.hpp:150
void Remove(const char *id)
Remove all topics marked with an id from publisher list.
Definition ngcdcsPUBLISHER.hpp:78
#define ngcdcsPUB_POSTPONE
Definition ngcdcsPUBLISHER.hpp:20
Definition ngcdcsEXP.hpp:141
char status[32]
Definition ngcdcsEXP.hpp:145
char id[64]
Definition ngcdcsEXP.hpp:142
char host[64]
Definition ngcdcsEXP.hpp:143
int method
Definition ngcdcsEXP.hpp:146
char fileName[256]
Definition ngcdcsEXP.hpp:144