8#ifndef ngcdcsPUBLISHER_H
9#define ngcdcsPUBLISHER_H
13#error This is a C++ include file and cannot be used from plain C
21#define ngcdcsPUB_POSTPONE 0x1
22#define ngcdcsPUB_KEEP 0x2
41 for (l=other.list_.
First();l!=NULL;l=l->
next)
54 for (l=other.list_.
First();l!=NULL;l=l->
next)
73 if (topic != NULL)
delete topic;
87 if (strcmp(topic->
id,
id) == 0)
89 list_.Remove(topic);
delete topic;
102 sprintf(s,
"%d",
id);
108 if (strcmp(topic.
status,
"Active") == 0)
120 PublishList_(topic.
id, topic.
status);
123 else if (strlen(topic.
fileName) > 0)
129 PublishList_(topic.
id, topic.
status);
132 else if (strlen(topic.
status) > 0)
137 PublishList_(topic.
id, topic.
status);
154 fprintf(stdout,
"data: %s,%s,%s:%s\n", topic.
id, topic.
status,
164 void PublishList_(
const char *
id,
const char *status) {
166 for (l = list_.
First(); l != NULL; l = l->
next)
171 if (strcmp(topic->
id,
id) == 0)
176 strcpy(topic->
status, status);
Definition ngcbLIST.hpp:34
void * item
Item.
Definition ngcbLIST.hpp:37
void Clear()
Clear list.
Definition ngcbLIST.cpp:40
ngcbLIST * First() const
Return list entry point.
Definition ngcbLIST.cpp:32
ngcbLIST * next
Next item.
Definition ngcbLIST.hpp:40
ngcdcsPUBLISHER & operator=(const ngcdcsPUBLISHER &other)
Operator =.
Definition ngcdcsPUBLISHER.hpp:37
int logLevel
Logging level.
Definition ngcdcsPUBLISHER.hpp:34
int verboseLevel
Verbose level.
Definition ngcdcsPUBLISHER.hpp:31
ngcdcsPUBLISHER(const ngcdcsPUBLISHER &other)
Copy constructor.
Definition ngcdcsPUBLISHER.hpp:50
void Remove(int id)
Remove all topics marked with an id from publisher list.
Definition ngcdcsPUBLISHER.hpp:100
ngcdcsPUBLISHER()
Constructor.
Definition ngcdcsPUBLISHER.hpp:62
void Clear()
Clear publisher list.
Definition ngcdcsPUBLISHER.hpp:68
void Push(const ngcdcs_exp_topic &topic)
Push topic to publisher.
Definition ngcdcsPUBLISHER.hpp:107
virtual ~ngcdcsPUBLISHER()
Destructor.
Definition ngcdcsPUBLISHER.hpp:65
virtual void Publish(const ngcdcs_exp_topic &topic)
Publisher.
Definition ngcdcsPUBLISHER.hpp:151
void Remove(const char *id)
Remove all topics marked with an id from publisher list.
Definition ngcdcsPUBLISHER.hpp:79
#define ngcdcsPUB_POSTPONE
Definition ngcdcsPUBLISHER.hpp:21
Definition ngcdcsEXP.hpp:142
char status[32]
Definition ngcdcsEXP.hpp:146
char id[64]
Definition ngcdcsEXP.hpp:143
char host[64]
Definition ngcdcsEXP.hpp:144
int method
Definition ngcdcsEXP.hpp:147
char fileName[256]
Definition ngcdcsEXP.hpp:145