MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / read

Method read

src/jrd/Monitoring.cpp:282–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280
281
282void MonitoringData::read(const char* userName, TempSpace& temp)
283{
284 offset_t position = temp.getSize();
285
286 // Copy data of all permitted sessions
287
288 for (ULONG offset = HEADER_SIZE; offset < m_sharedMemory->getHeader()->used;)
289 {
290 const auto ptr = (UCHAR*) m_sharedMemory->getHeader() + offset;
291 const auto element = (Element*) ptr;
292 const ULONG length = element->getBlockLength();
293
294 if (!userName || !strcmp(element->userName, userName)) // permitted
295 {
296 temp.write(position, ptr + sizeof(Element), element->length);
297 position += element->length;
298 }
299
300 offset += length;
301 }
302}
303
304
305ULONG MonitoringData::setup(AttNumber att_id, const char* userName, ULONG generation)

Callers 1

MonitoringSnapshotMethod · 0.45

Calls 4

getBlockLengthMethod · 0.80
getSizeMethod · 0.45
getHeaderMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected