Changeset 122 in flair-src for trunk/lib/FlairCore
- Timestamp:
- Jan 6, 2017, 1:56:26 PM (8 years ago)
- Location:
- trunk/lib/FlairCore/src
- Files:
-
- 2 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/FrameworkManager.cpp
r55 r122 178 178 } 179 179 180 bool FrameworkManager::IsDeviceLogged(const IODevice *device) const { 181 return pimpl_->IsDeviceLogged(device); 182 } 183 180 184 void FrameworkManager::StartLog(void) { pimpl_->StartLog(); } 181 185 -
trunk/lib/FlairCore/src/FrameworkManager.h
r55 r122 121 121 */ 122 122 void AddDeviceToLog(IODevice *device); 123 124 /*! 125 * \brief Is device logged 126 * 127 * Check if AddDeviceToLog was called for an IODevice 128 * 129 * \param device IODevice to check 130 * \return true if AddDeviceToLog was called for this IODevice 131 */ 132 bool IsDeviceLogged(const IODevice *device) const; 123 133 124 134 /*! -
trunk/lib/FlairCore/src/FrameworkManager_impl.cpp
r118 r122 630 630 631 631 if (is_logging == false) { 632 if (device->pimpl_->SetToBeLogged()) { 632 if (!device->pimpl_->IsSetToBeLogged()) { 633 device->pimpl_->SetToBeLogged(); 633 634 log_desc_t tmp; 634 635 tmp.device = device; … … 640 641 Err("impossible while logging\n"); 641 642 } 643 } 644 645 bool FrameworkManager_impl::IsDeviceLogged(const IODevice *device) const { 646 return device->pimpl_->IsSetToBeLogged(); 642 647 } 643 648 -
trunk/lib/FlairCore/src/IODevice_impl.cpp
r15 r122 106 106 } 107 107 108 bool IODevice_impl::SetToBeLogged(void) { 108 bool IODevice_impl::IsSetToBeLogged(void) const{ 109 return tobelogged; 110 } 111 112 void IODevice_impl::SetToBeLogged(void) { 109 113 if (!tobelogged) { 110 114 tobelogged = true; 111 return true;112 115 } else { 113 116 self->Warn("already added to log\n"); 114 return false;115 117 } 116 118 } 117 119 118 120 void IODevice_impl::WriteLogsDescriptors(fstream &desc_file, int *index) { 119 // own descriptor 121 //Printf("WriteLogsDescriptors %s\n",self->ObjectName().c_str()); 122 // own descriptor 120 123 for (size_t i = 0; i < datasToLog.size(); i++) 121 124 datasToLog.at(i)->pimpl_->WriteLogDescriptor(desc_file, index); … … 127 130 for (size_t i = 0; i < devicesToLog.size(); i++) 128 131 devicesToLog.at(i)->pimpl_->WriteLogsDescriptors(desc_file, index); 132 //Printf("WriteLogsDescriptors %s ok\n",self->ObjectName().c_str()); 129 133 } 130 134 … … 194 198 195 199 void IODevice_impl::AppendLog(char **ptr) { 196 //Printf("AppendLog %s %x\n",self->ObjectName().c_str(),*ptr);200 //Printf("AppendLog %s %x\n",self->ObjectName().c_str(),*ptr); 197 201 198 202 // copy state to buf 199 203 for (size_t i = 0; i < datasToLog.size(); i++) { 200 // printf("copy \n");204 // printf("copy %s\n",datasToLog.at(i)->ObjectName().c_str()); 201 205 datasToLog.at(i)->CopyDatas(*ptr); 202 206 (*ptr) += datasToLog.at(i)->GetDataType().GetSize(); -
trunk/lib/FlairCore/src/io_data_impl.cpp
r15 r122 42 42 43 43 void io_data_impl::WriteLogDescriptor(std::fstream &desc_file, int *index) { 44 if(descriptors.size()==0) self->Warn("AppendLogDescription was not called for this object.\n"); 44 45 for (size_t i = 0; i < descriptors.size(); i++) { 45 46 desc_file << (*index)++ << ": " << self->ObjectName() << " - " -
trunk/lib/FlairCore/src/unexported/FrameworkManager_impl.h
r55 r122 48 48 void SetupLogger(std::string log_path); 49 49 void AddDeviceToLog(flair::core::IODevice *device); 50 bool IsDeviceLogged(const flair::core::IODevice *device) const; 50 51 void StartLog(); 51 52 void StopLog(); -
trunk/lib/FlairCore/src/unexported/IODevice_impl.h
r15 r122 42 42 void WriteLog(flair::core::Time time); 43 43 void AddDeviceToLog(const flair::core::IODevice *device); 44 bool SetToBeLogged(void); // return true if possible 44 void SetToBeLogged(void); 45 bool IsSetToBeLogged(void) const; 45 46 void OutputToShMem(bool enabled); 46 47 void WriteToShMem(void);
Note:
See TracChangeset
for help on using the changeset viewer.