FACT++  1.0
DataLogger::~DataLogger ( )

Destructor.

Definition at line 1060 of file datalogger.cc.

References MessageImp::Debug(), dim_lock(), dim_unlock(), fCurrentSubscription, fNumSubAndFits, fOpenedNightlyFiles, fOpenedRunFiles, fServerDescriptionsList, GoToReady(), MessageImp::Info(), RemoveOldestRunNumber(), and MessageImp::Warn().

1061 {
1062  if (fDebugIsOn)
1063  Debug("DataLogger destruction starts");
1064 
1065  //this boolean should not be required anymore
1066  fDestructing = true;
1067 
1068  //now clear the services subscriptions
1069  dim_lock();
1070  fServiceSubscriptions.clear();
1071  dim_unlock();
1072 
1073  //clear any remaining run number (should remain only one)
1074  while (fRunNumber.size() > 0)
1075  {
1077  }
1078  //go to the ready state. i.e. close all files, run-wise first
1079  GoToReady();
1080 
1081  Info("Will soon close the daily log file");
1082 
1083  delete fOpenedNightlyFiles;
1084  delete fOpenedRunFiles;
1085  delete fNumSubAndFits;
1086  delete fCurrentSubscription;
1087 
1088  if (fNightlyLogFile.is_open())//this file is the only one that has not been closed by GoToReady
1089  {
1090  fNightlyLogFile << endl;
1091  fNightlyLogFile.close();
1092  }
1093  if (!fNightlyLogFile.is_open())
1094  Info("Daily log file was closed indeed");
1095  else
1096  Warn("Seems like there was a problem while closing the daily log file.");
1097  for (auto it=fServerDescriptionsList.begin(); it!= fServerDescriptionsList.end(); it++)
1098  delete *it;
1099 
1100  if (fDebugIsOn)
1101  Debug("DataLogger desctruction ends");
1102 }
vector< DimDescriptions * > fServerDescriptionsList
Definition: datalogger.cc:401
void RemoveOldestRunNumber()
removes the oldest run number, and close the relevant files.
Definition: datalogger.cc:891
int Debug(const std::string &str)
Definition: MessageImp.h:45
bool fDestructing
boolean to prevent DIM update while desctructing the dataLogger
Definition: datalogger.cc:326
ofstream fNightlyLogFile
ofstream for the NightlyLogfile
Definition: datalogger.cc:203
bool fDebugIsOn
configuration flags
Definition: datalogger.cc:315
DimDescribedService * fOpenedNightlyFiles
Service for opened files.
Definition: datalogger.cc:291
int GoToReady()
stop and reset transition
Definition: datalogger.cc:2151
DimDescribedService * fCurrentSubscription
Service for broadcasting subscription status.
Definition: datalogger.cc:297
void dim_unlock()
Definition: dim_thr.c:472
int Warn(const std::string &str)
Definition: MessageImp.h:48
DimDescribedService * fNumSubAndFits
Definition: datalogger.cc:293
void dim_lock()
Definition: dim_thr.c:455
SubscriptionsListType fServiceSubscriptions
All the services to which we have subscribed to, sorted by server name.
Definition: datalogger.cc:224
DimDescribedService * fOpenedRunFiles
Definition: datalogger.cc:292
list< RunNumberType > fRunNumber
run numbers
Definition: datalogger.cc:211
int Info(const std::string &str)
Definition: MessageImp.h:47

+ Here is the call graph for this function: