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

Stores minimal metadata for one frame-style time window. More...

#include <gFrameHeader.h>

Public Member Functions

 GFrameHeader (long int frameID_, double frameDuration_, std::shared_ptr< GLogger > logger)
 Construct a frame header.
 
 ~GFrameHeader ()
 Destructor.
 
long int getFrameID () const
 Returns the frame identifier.
 
long int getTime () const
 Returns a deterministic time coordinate for the frame.
 

Static Public Member Functions

static std::unique_ptr< GFrameHeadercreate (std::shared_ptr< GLogger > logger)
 Test/example factory creating a header with a unique frame ID.
 

Detailed Description

Definition at line 44 of file gFrameHeader.h.

Constructor & Destructor Documentation

◆ GFrameHeader()

GFrameHeader::GFrameHeader ( long int frameID_,
double frameDuration_,
std::shared_ptr< GLogger > logger )
inline

The constructor stores the provided identifier and duration and emits a debug message.

Ownership:

  • the logger is stored as a shared pointer and may be shared across many headers/collections
Parameters
frameID_Frame index or identifier, typically monotonic in usage.
frameDuration_Duration of one frame in caller-defined units.
loggerLogger used for construction/destruction diagnostics.

Definition at line 60 of file gFrameHeader.h.

◆ ~GFrameHeader()

GFrameHeader::~GFrameHeader ( )
inline

A debug message is emitted when a logger is available. Logging is guarded by a null check so destruction remains tolerant of absent logger instances.

Definition at line 72 of file gFrameHeader.h.

Member Function Documentation

◆ create()

static std::unique_ptr< GFrameHeader > GFrameHeader::create ( std::shared_ptr< GLogger > logger)
inlinestatic

The duration is set to a fixed example value. This helper is intended for examples and tests rather than production payload generation.

Threading:

  • uses a global atomic counter so concurrent calls can produce unique IDs
Parameters
loggerLogger instance.
Returns
Newly created header.

Definition at line 87 of file gFrameHeader.h.

◆ getFrameID()

long int GFrameHeader::getFrameID ( ) const
inline
Returns
Frame ID.

Definition at line 98 of file gFrameHeader.h.

◆ getTime()

long int GFrameHeader::getTime ( ) const
inline

Computed as:

frameID * frameDuration

Units are inherited from frameDuration and are therefore caller-defined.

Returns
Time coordinate for this frame.

Definition at line 113 of file gFrameHeader.h.


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