FACT++  1.0
void DimInfo::subscribe ( char *  name,
int  time,
void *  nolink,
int  nolinksize,
DimInfoHandler handler 
)
virtual

Reimplemented in DimUpdatedInfo, and DimStampedInfo.

Definition at line 152 of file diccpp.cxx.

References doIt(), handler(), itsData, itsDataSize, itsFormat, itsHandler, itsId, itsName, itsNolinkBuf, itsNolinkSize, itsSize, itsTime, itsType, MONITORED, ONCE_ONLY, and time.

Referenced by DimStampedInfo::DimStampedInfo(), DimUpdatedInfo::DimUpdatedInfo(), DimStampedInfo::subscribe(), and DimUpdatedInfo::subscribe().

154 {
155  itsId = 0;
156  itsData = 0;
157  itsFormat = 0;
159  itsDataSize = 0;
160  itsSize = 0;
161  itsNolinkBuf = 0;
162  itsNolinkSize = 0;
163  itsName = 0;
164  if(!name)
165  {
166  return;
167  }
168  itsName = new char[(int)strlen(name)+1];
169  strcpy(itsName,name);
170  itsNolinkBuf = nolink;
171  itsNolinkSize = nolinksize;
172  if(nolinksize > 0)
173  {
174  itsNolinkBuf = new char[nolinksize];
175  itsNolinkSize = nolinksize;
176  memcpy(itsNolinkBuf, nolink, (size_t)nolinksize);
177  }
178  if(!time)
179  {
180  itsType = MONITORED;
181  itsTime = 0;
182  }
183  else if(time > 0)
184  {
185  itsType = MONITORED;
186  itsTime = time;
187  }
188  else
189  {
190  itsType = ONCE_ONLY;
191  itsTime = 30;
192  }
193  doIt();
194 }
#define MONITORED
Definition: dim_common.h:9
int itsSize
Definition: dic.hxx:99
virtual void doIt()
Definition: diccpp.cxx:89
int itsId
Definition: dic.hxx:125
void * itsData
Definition: dic.hxx:97
char * itsName
Definition: dic.hxx:121
void * itsNolinkBuf
Definition: dic.hxx:130
char * itsFormat
Definition: dic.hxx:129
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
Definition: smartfact.txt:92
DimInfoHandler * itsHandler
Definition: dic.hxx:34
static void handler(int conn_id, char *packet, int size, int status)
Definition: webServer.c:635
int itsType
Definition: dic.hxx:127
int itsNolinkSize
Definition: dic.hxx:131
#define ONCE_ONLY
Definition: dim_common.h:7
int itsDataSize
Definition: dic.hxx:98
int itsTime
Definition: dic.hxx:126

+ Here is the call graph for this function:

+ Here is the caller graph for this function: