FACT++  1.0
void DataLogger::NotifyOpenedFile ( const string &  name,
int  type,
DimDescribedService service 
)
inlineprivate

Notifies the DIM service that a particular file was opened @ param name the base name of the opened file, i.e. without path nor extension. WARNING: use string instead of string& because I pass values that do not convert to string&. this is not a problem though because file are not opened so often. @ param type the type of the opened file. 0 = none open, 1 = log, 2 = text, 4 = fits

Definition at line 1781 of file datalogger.cc.

References OpenFileToDim::code, MessageImp::Debug(), MessageImp::Error(), OpenFileToDim::fileName, DimService::getName(), NumSubAndFitsType::numOpenFits, NumSubAndFitsType::numSubscriptions, DimDescribedService::setData(), DimService::setQuality(), str, type, and DimDescribedService::Update().

Referenced by DataLogger(), EvalOptions(), GoToReady(), and Start().

1782 {
1783  if (!fOpenedFilesIsOn)
1784  return;
1785 
1786  if (fDebugIsOn)
1787  {
1788  ostringstream str;
1789  str << "Updating " << service->getName() << " file '" << name << "' (type=" << type << ")";
1790  Debug(str);
1791 
1792  str.str("");
1793  str << "Num subscriptions: " << fNumSubAndFitsData.numSubscriptions << " Num open FITS files: " << fNumSubAndFitsData.numOpenFits;
1794  Debug(str);
1795  }
1796 
1797  if (name.size()+1 > FILENAME_MAX)
1798  {
1799  Error("Provided file name '" + name + "' is longer than allowed file name length.");
1800  return;
1801  }
1802 
1803  OpenFileToDim fToDim;
1804  fToDim.code = type;
1805  memcpy(fToDim.fileName, name.c_str(), name.size()+1);
1806 
1807  service->setData(reinterpret_cast<void*>(&fToDim), name.size()+1+sizeof(uint32_t));
1808  service->setQuality(0);
1809  service->Update();
1810 }
uint32_t numSubscriptions
Definition: datalogger.cc:96
uint32_t numOpenFits
Definition: datalogger.cc:97
int Debug(const std::string &str)
Definition: MessageImp.h:45
void setQuality(int quality)
Definition: discpp.cxx:1256
char str[80]
Definition: test_client.c:7
bool fDebugIsOn
configuration flags
Definition: datalogger.cc:315
char fileName[FILENAME_MAX]
Definition: datalogger.cc:102
distributes which files were opened.
Definition: datalogger.cc:100
int type
void setData(const void *ptr, size_t sz)
int Error(const std::string &str)
Definition: MessageImp.h:49
bool fOpenedFilesIsOn
Definition: datalogger.cc:316
char * getName()
Definition: discpp.cxx:1305
NumSubAndFitsType fNumSubAndFitsData
Definition: datalogger.cc:294
uint32_t code
Definition: datalogger.cc:101

+ Here is the call graph for this function:

+ Here is the caller graph for this function: