Add a new service subscription.
568 const string& serverr = svc.
server;
570 string server = serverr;
571 if (server.size() > 0 && server[0] ==
'+')
573 server = server.substr(1);
574 Warn(
"Got a service beginning with +. This is not supposed to happen");
578 const string& service = svc.
service;
579 const bool isCmd = svc.
iscmd;
585 Info(
"Got request to add service: "+server+
"/"+service);
593 if (list.find(service) != list.end())
595 if (list[service].format != svc.
format)
597 if (list[service].nightlyFile.IsOpen())
599 string fileName = list[service].nightlyFile.GetName();
602 Error(
"Something went wrong while dealing with new format of "+server+
"/"+service+
" file tagged as open but filename is empty. Aborting");
605 list[service].nightlyFile.Close();
606 list[service].increment++;
607 Warn(
"Format of "+server+
"/"+service+
" has changed. Closing "+fileName);
626 list[service].fitsBufferAllocated =
false;
629 list[service].format = svc.
format;
632 Debug(
"Service " + server +
"/" + service +
" is already in the dataLogger's list... ignoring update.");
638 Debug(
"Subscribing to service "+server+
"/"+service);
641 list[service].server = server;
642 list[service].service = service;
643 list[service].format = svc.
format;
647 if ((server ==
"FAD_CONTROL") && (service ==
"START_RUN"))
650 Info(
"Added subscription to " + server +
"/" + service);
uint32_t numSubscriptions
int Debug(const std::string &str)
bool ShouldSubscribe(const string &server, const string &service)
Check whether service is in black and/or white list.
bool fDebugIsOn
configuration flags
std::ostream & Out() const
unsigned int fRunNumberService
pointer to the dim's subscription that should distribute the run numbers.
int Error(const std::string &str)
int Warn(const std::string &str)
int infoCallback(const EventImp &evt, unsigned int infoIndex)
Inherited from DimInfo. Handles all the Infos to which we subscribed, and log them.
SubscriptionsListType fServiceSubscriptions
All the services to which we have subscribed to, sorted by server name.
EventImp & Subscribe(const std::string &name)
NumSubAndFitsType fNumSubAndFitsData
int Info(const std::string &str)
A compiler for the DIM data format string.
unsigned int servicesCounter