void AbstractAnalysisData::applyModule(AnalysisDataModuleInterface *module) { if ((columnCount() > 1 && !(module->flags() & AnalysisDataModuleInterface::efAllowMulticolumn)) || (isMultipoint() && !(module->flags() & AnalysisDataModuleInterface::efAllowMultipoint)) || (!isMultipoint() && (module->flags() & AnalysisDataModuleInterface::efOnlyMultipoint))) { GMX_THROW(APIError("Data module not compatible with data object properties")); } GMX_RELEASE_ASSERT(_impl->_bDataStart && !_impl->_bInData, "Data module can only be applied to ready data"); _impl->presentData(this, module); }
bool AbstractAnalysisDataStored::requestStorage(int nframes) { GMX_RELEASE_ASSERT(nframes >= -1, "Invalid number of frames requested"); if (nframes == 0) { return true; } GMX_RELEASE_ASSERT(!isMultipoint(), "Storage of multipoint data not supported"); // Handle the case when everything needs to be stored. if (nframes == -1) { _impl->_bStoreAll = true; _impl->_nalloc = 1; return true; } // Check whether an earier call has requested more storage. if (_impl->_bStoreAll || nframes < _impl->_nalloc) { return true; } _impl->_nalloc = nframes; return true; }
void AbstractAnalysisData::addModule(AnalysisDataModulePointer module) { if ((columnCount() > 1 && !(module->flags() & AnalysisDataModuleInterface::efAllowMulticolumn)) || (isMultipoint() && !(module->flags() & AnalysisDataModuleInterface::efAllowMultipoint)) || (!isMultipoint() && (module->flags() & AnalysisDataModuleInterface::efOnlyMultipoint))) { GMX_THROW(APIError("Data module not compatible with data object properties")); } if (impl_->bDataStart_) { GMX_RELEASE_ASSERT(!impl_->bInFrame_, "Cannot add data modules in mid-frame"); impl_->presentData(this, module.get()); } if (!(module->flags() & AnalysisDataModuleInterface::efAllowMissing)) { impl_->bAllowMissing_ = false; } impl_->modules_.push_back(module); }
void AbstractAnalysisData::addModule(AnalysisDataModuleInterface *module) { std::auto_ptr<AnalysisDataModuleInterface> module_ptr(module); if ((columnCount() > 1 && !(module->flags() & AnalysisDataModuleInterface::efAllowMulticolumn)) || (isMultipoint() && !(module->flags() & AnalysisDataModuleInterface::efAllowMultipoint)) || (!isMultipoint() && (module->flags() & AnalysisDataModuleInterface::efOnlyMultipoint))) { GMX_THROW(APIError("Data module not compatible with data object properties")); } if (_impl->_bDataStart) { GMX_RELEASE_ASSERT(!_impl->_bInFrame, "Cannot add data modules in mid-frame"); _impl->presentData(this, module); } if (!(module->flags() & AnalysisDataModuleInterface::efAllowMissing)) { _impl->_bAllowMissing = false; } _impl->_modules.push_back(module); module_ptr.release(); }