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

#include <gFrameHeader.h>

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Definition at line 30 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; it may be shared across many headers/collections.
Parameters
frameID_Frame index/identifier (monotonic in typical usage).
frameDuration_Duration of one frame in caller-defined units.
loggerLogger used for construction/destruction diagnostics.

Definition at line 46 of file gFrameHeader.h.

◆ ~GFrameHeader()

GFrameHeader::~GFrameHeader ( )
inline

Logging is guarded by a null check to tolerate cases where the logger is absent.

Definition at line 57 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 is meant for examples/tests, not physics production.

Threading:

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

Definition at line 72 of file gFrameHeader.h.

◆ getFrameID()

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

Definition at line 82 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 97 of file gFrameHeader.h.


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