FACT++  1.0
void DataLogger::RemoveService ( const string  server,
const string  service,
bool  isCmd 
)
private

Remove a given service subscription.

Remove a given service subscription

Parameters
serverthe server for which the subscription should be removed
servicethe service that should be removed
isCmdwhether or not this is a command

Definition at line 659 of file datalogger.cc.

References Error(), and NumSubAndFitsType::numSubscriptions.

Referenced by Report(), and Start().

660 {
661 
662  Info("Got request to remove service: "+server+"/"+service);
663  if (fDestructing)//this function is called by the super class, after the destructor has deleted its own subscriptions
664  return;
665 //FIXME unused
666  return;
667 
668  if (isCmd)
669  return;
670 
671  if (fServiceSubscriptions.find(server) == fServiceSubscriptions.end())
672  {
673  Error("Request to remove service "+service+" from server "+server+", but service not found.");
674  return;
675  }
676 
677  if (fServiceSubscriptions[server].erase(service) != 1)
678  {
679  //check the given subscription against black and white lists
680  if (!ShouldSubscribe(server, service))
681  return;
682 
683  Error("Subscription "+server+"/"+service+" could not be removed as it is not present");
684  return;
685  }
687 
688  if ((server == "FAD_CONTROL") && (service == "START_RUN"))
689  fRunNumberService = 0;
690 
691  Info("Removed subscription to " + server + "/" + service);
692 }
uint32_t numSubscriptions
Definition: datalogger.cc:96
bool fDestructing
boolean to prevent DIM update while desctructing the dataLogger
Definition: datalogger.cc:326
bool ShouldSubscribe(const string &server, const string &service)
Check whether service is in black and/or white list.
Definition: datalogger.cc:808
unsigned int fRunNumberService
pointer to the dim's subscription that should distribute the run numbers.
Definition: datalogger.cc:387
int Error(const std::string &str)
Definition: MessageImp.h:49
SubscriptionsListType fServiceSubscriptions
All the services to which we have subscribed to, sorted by server name.
Definition: datalogger.cc:224
NumSubAndFitsType fNumSubAndFitsData
Definition: datalogger.cc:294
int Info(const std::string &str)
Definition: MessageImp.h:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function: