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

Minimal run metadata: run ID and integrated-event counter. More...

#include <gRunHeader.h>

Public Member Functions

 GRunHeader (const std::shared_ptr< GOptions > &gopts, int rid, int tid=-1)
 Construct a run header.
 
auto getRunID () const -> int
 Get the run identifier.
 
auto get_events_processed () const -> int
 Get the number of events integrated into this run summary so far.
 
void increment_events_processed ()
 Increment the number of processed events.
 
- 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

This object is typically owned by GRunDataCollection as a std::unique_ptr. It provides:

  • stable access to run identifier
  • a simple counter tracking how many events were integrated

The counter is incremented via increment_events_processed().

Note
GRunDataCollection does not automatically increment this counter in the current implementation. If you want the value to reflect integrated events, ensure the caller (or the run collection) invokes increment_events_processed() once per event.

Definition at line 61 of file gRunHeader.h.

Constructor & Destructor Documentation

◆ GRunHeader()

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

The constructor logs:

  • run ID
  • initial event count (usually 0)
  • optional thread ID if provided
Parameters
goptsShared options object used to configure logging and behavior.
ridRun identifier.
tidOptional thread ID for diagnostic labeling (default -1 = unspecified).

Definition at line 77 of file gRunHeader.h.

Member Function Documentation

◆ get_events_processed()

auto GRunHeader::get_events_processed ( ) const -> int
inline

This value is incremented by increment_events_processed(). Typical usage is "once per event integrated into the run accumulator".

Returns
Number of processed events.

Definition at line 108 of file gRunHeader.h.

◆ getRunID()

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

Definition at line 97 of file gRunHeader.h.

◆ increment_events_processed()

void GRunHeader::increment_events_processed ( )
inline

Intended to be called once per event integrated into the run accumulator.

Definition at line 116 of file gRunHeader.h.


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