8#ifndef INCLUDED_BDLMT_TIMEREVENTSCHEDULER
9#define INCLUDED_BDLMT_TIMEREVENTSCHEDULER
379#include <bdlscm_version.h>
402#include <bsl_functional.h>
403#include <bsl_memory.h>
404#include <bsl_string.h>
405#include <bsl_vector.h>
410struct TimerEventSchedulerDispatcher;
411class TimerEventSchedulerTestTimeSource_Data;
460 : d_callback(bsl::allocator_arg_t(),
463 , d_periodicInterval(interval)
464 , d_isCancelled(
false)
469 ClockData(
const ClockData& original,
471 : d_callback(bsl::allocator_arg_t(),
474 , d_periodicInterval(original.d_periodicInterval)
475 , d_isCancelled(original.d_isCancelled.load())
476 , d_handle(original.d_handle.load())
503#ifndef BDE_OMIT_INTERNAL_DEPRECATED
511 static const char s_defaultThreadName[16];
518 d_currentTimeFunctor;
523 d_clockDataAllocator;
525 EventTimeQueue d_eventTimeQueue;
528 ClockTimeQueue d_clockTimeQueue;
564 int d_currentEventIndex;
613 void yieldToDispatcher();
1112 return d_currentTimeFunctor();
#define BSLMF_NESTED_TRAIT_DECLARATION(t_TYPE, t_TRAIT)
Definition bslmf_nestedtraitdeclaration.h:231
Definition bdlcc_objectcatalog.h:412
Definition bdlcc_timequeue.h:1135
Definition bdlcc_timequeue.h:731
Definition bdlcc_timequeue.h:706
Definition bdlm_metricsregistry.h:287
Definition bdlm_metricsregistry.h:199
Definition bdlma_concurrentpool.h:332
Definition bdlmt_timereventscheduler.h:1039
TimerEventSchedulerTestTimeSource(TimerEventScheduler *scheduler)
bsls::TimeInterval now() const
bsls::TimeInterval advanceTime(bsls::TimeInterval amount)
Definition bdlmt_timereventscheduler.h:434
int Handle
Definition bdlmt_timereventscheduler.h:492
int rescheduleEvent(Handle handle, const bsls::TimeInterval &newTime, bool wait=false)
Definition bdlmt_timereventscheduler.h:1095
@ BCEP_INVALID_HANDLE
Definition bdlmt_timereventscheduler.h:504
@ e_INVALID_HANDLE
Definition bdlmt_timereventscheduler.h:502
@ INVALID_HANDLE
Definition bdlmt_timereventscheduler.h:505
TimerEventScheduler(bsls::SystemClockType::Enum clockType, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(bsls::SystemClockType::Enum clockType, const bsl::string_view &eventSchedulerName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(int numEvents, int numClocks, const Dispatcher &dispatcherFunctor, bsls::SystemClockType::Enum clockType, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(int numEvents, int numClocks, const Dispatcher &dispatcherFunctor, bslma::Allocator *basicAllocator=0)
bsls::SystemClockType::Enum clockType() const
Return the value of the clock type that this object was created with.
Definition bdlmt_timereventscheduler.h:1104
int numClocks() const
Definition bdlmt_timereventscheduler.h:1116
void cancelAllClocks(bool wait=false)
int numEvents() const
Definition bdlmt_timereventscheduler.h:1122
TimerEventScheduler(int numEvents, int numClocks, bsls::SystemClockType::Enum clockType, const bsl::string_view &eventSchedulerName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(const Dispatcher &dispatcherFunctor, const bsl::string_view &eventSchedulerName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(int numEvents, int numClocks, bslma::Allocator *basicAllocator=0)
Handle startClock(const bsls::TimeInterval &interval, const bsl::function< void()> &callback, const bsls::TimeInterval &startTime=bsls::TimeInterval(0))
TimerEventScheduler(int numEvents, int numClocks, const Dispatcher &dispatcherFunctor, bsls::SystemClockType::Enum clockType, const bsl::string_view &eventSchedulerName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(const Dispatcher &dispatcherFunctor, bsls::SystemClockType::Enum clockType, const bsl::string_view &eventSchedulerName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
void cancelAllEvents(bool wait=false)
bsls::TimeInterval nextPendingEventTime() const
bdlcc::TimeQueue< bsl::function< void()> >::Key EventKey
Defines a type alias for a user-supplied key for identifying events.
Definition bdlmt_timereventscheduler.h:498
int rescheduleEvent(Handle handle, const EventKey &key, const bsls::TimeInterval &newTime, bool wait=false)
bsls::TimeInterval now() const
Definition bdlmt_timereventscheduler.h:1110
Handle scheduleEvent(const bsls::TimeInterval &time, const bsl::function< void()> &callback, const EventKey &key=EventKey(0))
bsl::function< void(const bsl::function< void()> &)> Dispatcher
Defines a type alias for the dispatcher functor type.
Definition bdlmt_timereventscheduler.h:495
TimerEventScheduler(int numEvents, int numClocks, const Dispatcher &dispatcherFunctor, const bsl::string_view &eventSchedulerName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(const bsl::string_view &eventSchedulerName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(int numEvents, int numClocks, const bsl::string_view &eventSchedulerName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(bslma::Allocator *basicAllocator=0)
BSLMF_NESTED_TRAIT_DECLARATION(TimerEventScheduler, bslma::UsesBslmaAllocator)
TimerEventScheduler(const Dispatcher &dispatcherFunctor, bslma::Allocator *basicAllocator=0)
TimerEventScheduler(const Dispatcher &dispatcherFunctor, bsls::SystemClockType::Enum clockType, bslma::Allocator *basicAllocator=0)
int cancelEvent(Handle handle, const EventKey &key, bool wait=false)
int cancelClock(Handle handle, bool wait=false)
int start(const bslmt::ThreadAttributes &threadAttributes)
int cancelEvent(Handle handle, bool wait=false)
Definition bdlmt_timereventscheduler.h:1088
friend struct TimerEventSchedulerDispatcher
Definition bdlmt_timereventscheduler.h:599
TimerEventScheduler(int numEvents, int numClocks, bsls::SystemClockType::Enum clockType, bslma::Allocator *basicAllocator=0)
Definition bslma_bslallocator.h:580
Definition bslstl_stringview.h:441
Definition bslstl_string.h:1281
Forward declaration.
Definition bslstl_function.h:934
Definition bslstl_sharedptr.h:1830
Definition bslstl_vector.h:1025
Definition bslma_allocator.h:457
Definition bslmt_condition.h:220
Definition bslmt_mutex.h:315
Definition bslmt_threadattributes.h:356
Definition bsls_atomic.h:1472
Definition bsls_atomic.h:892
Definition bsls_atomic.h:743
Definition bsls_timeinterval.h:301
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlmt_eventscheduler.h:522
Definition bslma_usesbslmaallocator.h:343
Imp::Handle Handle
Definition bslmt_threadutil.h:385
Enum
Definition bsls_systemclocktype.h:117