struct
#include <src/vt/epoch/epoch_window.h>
EpochWindow Allocates new epochs and holds the set of terminated epochs for a given epoch "archetype".
An epoch's archetype is the epoch's control bits that make it belong to a certain category/scope/root/etc. based on the control bit pattern. The window tracks the state of all the epochs with a certain control bit configuration. Because the control bits are embedded in the high bits, the window starts contiguous and may get fragmented as epochs are activated and then terminate out of order.
Constructors, destructors, conversion operators
- EpochWindow(EpochType in_epoch) explicit
- Initialize the
EpochWindow
with a given epoch's archetype.
Public functions
- auto getFirst() const -> EpochType
- Get the first terminated epoch in the window.
- auto getLast() const -> EpochType
- Get the last terminated epoch in the window.
- auto isTerminated(EpochType epoch) const -> bool
- Check if an epoch is terminated or not.
- void setEpochTerminated(EpochType epoch)
- Tell the epoch window that an epoch has been terminated.
- auto getSize() const -> std::size_t
- Get the size of the current terminated epochs set.
- auto getTotalTerminated() const -> uint64_t
- Get the total number of terminated epochs.
- auto allocateNewEpoch() -> EpochType
- Allocate/generate a new epoch with the proper control bits.
-
template<typename Serializer>void serialize(Serializer& s)
- void activateEpoch(EpochType epoch)
- Activate an epoch: goes from the state terminated to non-terminated.
Function documentation
vt::epoch::EpochWindow:: EpochWindow(EpochType in_epoch) explicit
Initialize the EpochWindow
with a given epoch's archetype.
Parameters | |
---|---|
in_epoch in | the epoch with the control bits for this window |
bool vt::epoch::EpochWindow:: isTerminated(EpochType epoch) const
Check if an epoch is terminated or not.
Parameters | |
---|---|
epoch in | the epoch to check for termination |
void vt::epoch::EpochWindow:: setEpochTerminated(EpochType epoch)
Tell the epoch window that an epoch has been terminated.
Parameters | |
---|---|
epoch in | the epoch that has terminated |
uint64_t vt::epoch::EpochWindow:: getTotalTerminated() const
Get the total number of terminated epochs.
Returns | the total number of epochs that have started and terminated while the runtime was active |
---|
EpochType vt::epoch::EpochWindow:: allocateNewEpoch()
Allocate/generate a new epoch with the proper control bits.
Returns | a new epoch within the window |
---|
void vt::epoch::EpochWindow:: activateEpoch(EpochType epoch)
Activate an epoch: goes from the state terminated to non-terminated.
Parameters | |
---|---|
epoch in | the epoch to activate |