/*! * Defining default behaviour for passing signal forward. * _visited helps to only signal once cyclic pipelines. * */ virtual void signalEvent(int i) override final { if(_visited) return; _visited = true; if (this->decSig() == 0) _dataEnd(i); for (auto &it : this->next()) { it.second->signalEvent(i); } _visited = false; }
bool indri::file::BulkBlock::insert(const char* key, int keyLength, const char* data, int dataLength) { if (_canInsert(keyLength, dataLength) == false) return false; int insertPoint = _dataEnd(); memcpy(_buffer + insertPoint, key, keyLength); memcpy(_buffer + insertPoint + keyLength, data, dataLength); _storeKeyValueLength(insertPoint, keyLength, dataLength); (*(UINT16*)_buffer) += 1; return true; }
inline int indri::file::BulkBlock::_remainingCapacity() { int startDataSize = _dataEnd(); return BULK_BLOCK_SIZE - startDataSize - count()*2*sizeof(UINT16); }