gdata
Loading...
Searching...
No Matches
GRunHeader Class Reference

Stores minimal run metadata and run-level event counters. More...

#include <gRunHeader.h>

Public Member Functions

 GRunHeader (const std::shared_ptr< GOptions > &gopts, int rid, int tid=-1)
 Constructs a run header.
 
auto getRunID () const -> int
 Returns the run identifier.
 
auto get_events_processed () const -> int
 Returns the total number of processed events tracked by this header.
 
auto get_events_with_payload () const -> int
 Returns the number of processed events that contributed payload.
 
void increment_events_processed ()
 Increments the processed-event counter by one.
 
void increment_events_with_payload ()
 Increments the payload-producing-event counter by one.
 
void add_events_processed (int count)
 Adds an arbitrary number of processed events to the counter.
 
void add_events_with_payload (int count)
 Adds an arbitrary number of payload-producing events to the counter.
 
- Public Member Functions inherited from GBase< GRunHeader >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Protected Attributes inherited from GBase< GRunHeader >
std::shared_ptr< GLoggerlog
 

Detailed Description

Main responsibilities:

  • preserve the run identifier
  • track how many events were processed
  • track how many processed events produced payload relevant to the run summary

Ownership:

Synchronization:

  • this class does not perform internal synchronization
  • concurrent updates require external coordination

Definition at line 68 of file gRunHeader.h.

Constructor & Destructor Documentation

◆ GRunHeader()

GRunHeader::GRunHeader ( const std::shared_ptr< GOptions > & gopts,
int rid,
int tid = -1 )
inline

The constructor initializes the run identifier and leaves both counters at zero. It also emits a summary through the logger.

Parameters
goptsShared options used to configure logging and related behavior.
ridRun identifier.
tidOptional thread identifier used for diagnostics, defaulting to -1.

Definition at line 82 of file gRunHeader.h.

Member Function Documentation

◆ add_events_processed()

void GRunHeader::add_events_processed ( int count)
inline
Parameters
countNumber of processed events to add.

Definition at line 143 of file gRunHeader.h.

◆ add_events_with_payload()

void GRunHeader::add_events_with_payload ( int count)
inline
Parameters
countNumber of payload-producing events to add.

Definition at line 150 of file gRunHeader.h.

◆ get_events_processed()

auto GRunHeader::get_events_processed ( ) const -> int
inline
Returns
Number of processed events.

Definition at line 112 of file gRunHeader.h.

◆ get_events_with_payload()

auto GRunHeader::get_events_with_payload ( ) const -> int
inline
Returns
Number of payload-producing events.

Definition at line 119 of file gRunHeader.h.

◆ getRunID()

auto GRunHeader::getRunID ( ) const -> int
inline
Returns
Run identifier.

Definition at line 105 of file gRunHeader.h.

◆ increment_events_processed()

void GRunHeader::increment_events_processed ( )
inline

Intended to be called once per event entering the run-summary flow.

Definition at line 127 of file gRunHeader.h.

◆ increment_events_with_payload()

void GRunHeader::increment_events_with_payload ( )
inline

Intended to be called once for each processed event that actually contributes payload to the run summary.

Definition at line 136 of file gRunHeader.h.


The documentation for this class was generated from the following file: