Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ReschedulingEvent Class Reference
Inheritance diagram for ReschedulingEvent:
[legend]
Collaboration diagram for ReschedulingEvent:
[legend]

Public Member Functions

 ReschedulingEvent (const Time &t, TimeoutQueue *q, int max_resc, int step_ms=50)
 
void EventFct () override
 Event handler function to be overridden.
 
- Public Member Functions inherited from TimeoutQueue::Event
 ~Event () noexcept override
 
Execution_Status get_execution_status () const
 
Time getAbsoluteTime () const
 
void set_for_deletion ()
 
EventId get_id () const
 Get the unique event ID (auto-generated on construction)
 
const std::string & get_name () const
 Get the event name (for debugging)
 
void set_name (const std::string &name)
 Set the event name.
 
void set_completion_callback (CompletionCallback cb)
 Set the completion callback (called after EventFct completes or the event is canceled)
 

Public Attributes

TimeoutQueue * queue
 
int reschedule_count
 
int max_reschedules
 
int reschedule_step_ms
 
atomic< int > execution_count {0}
 

Additional Inherited Members

- Public Types inherited from TimeoutQueue::Event
enum  Execution_Status {
  Out_Queue , In_Queue , Canceled , Executing ,
  Executed , To_Delete , Deleted
}
 Possible states of an event in its lifecycle. More...
 
using CompletionCallback = std::function< void(Event *, Execution_Status)>
 Optional callback invoked after an event completes, is canceled, or is deleted.
 
using EventId = uint64_t
 Type for unique event identifiers.
 
- Static Public Attributes inherited from TimeoutQueue::Event
static constexpr EventId InvalidId = 0
 Invalid/null event ID.
 
- Protected Member Functions inherited from TimeoutQueue::Event
 Event (const Time &t, std::string name="")
 
 Event (const long sec, const long nsec, std::string name="")
 

Detailed Description

Definition at line 143 of file timeoutQueue_test.cc.

Constructor & Destructor Documentation

◆ ReschedulingEvent()

ReschedulingEvent::ReschedulingEvent ( const Time &  t,
TimeoutQueue *  q,
int  max_resc,
int  step_ms = 50 
)
inline

Definition at line 152 of file timeoutQueue_test.cc.

Member Function Documentation

◆ EventFct()

void ReschedulingEvent::EventFct ( )
inlineoverridevirtual

Event handler function to be overridden.

This pure virtual function is called when the event's trigger time arrives. Override this in derived classes to implement custom event behavior. *

Implements TimeoutQueue::Event.

Definition at line 157 of file timeoutQueue_test.cc.

References execution_count, max_reschedules, queue, reschedule_count, TimeoutQueue::reschedule_event(), reschedule_step_ms, and time_from_now_ms().

Member Data Documentation

◆ execution_count

atomic<int> ReschedulingEvent::execution_count {0}

Definition at line 150 of file timeoutQueue_test.cc.

Referenced by EventFct().

◆ max_reschedules

int ReschedulingEvent::max_reschedules

Definition at line 148 of file timeoutQueue_test.cc.

Referenced by EventFct().

◆ queue

TimeoutQueue* ReschedulingEvent::queue

Definition at line 146 of file timeoutQueue_test.cc.

Referenced by EventFct().

◆ reschedule_count

int ReschedulingEvent::reschedule_count

Definition at line 147 of file timeoutQueue_test.cc.

Referenced by EventFct().

◆ reschedule_step_ms

int ReschedulingEvent::reschedule_step_ms

Definition at line 149 of file timeoutQueue_test.cc.

Referenced by EventFct().


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