8#ifndef INCLUDED_BDLMT_TIMEREVENTSCHEDULER
9#define INCLUDED_BDLMT_TIMEREVENTSCHEDULER
390#include <bdlscm_version.h>
413#include <bsl_functional.h>
414#include <bsl_memory.h>
415#include <bsl_string.h>
416#include <bsl_vector.h>
421struct TimerEventSchedulerDispatcher;
422class TimerEventSchedulerTestTimeSource_Data;
476 , d_periodicInterval(interval)
477 , d_isCancelled(
false)
482 ClockData(
const ClockData& original,
487 , d_periodicInterval(original.d_periodicInterval)
488 , d_isCancelled(original.d_isCancelled.load())
489 , d_handle(original.d_handle.load())
517#ifndef BDE_OMIT_INTERNAL_DEPRECATED
525 static const char s_defaultThreadName[16];
532 d_currentTimeFunctor;
537 d_clockDataAllocator;
539 EventTimeQueue d_eventTimeQueue;
542 ClockTimeQueue d_clockTimeQueue;
584 int d_currentEventIndex;
637 void yieldToDispatcher();
1160 return d_currentTimeFunctor();
#define BSLMF_NESTED_TRAIT_DECLARATION(t_TYPE, t_TRAIT)
Definition bslmf_nestedtraitdeclaration.h:231
Definition bdlcc_objectcatalog.h:410
Definition bdlcc_timequeue.h:1193
Definition bdlcc_timequeue.h:759
Definition bdlcc_timequeue.h:734
Definition bdlm_metricsregistry.h:306
Definition bdlm_metricsregistry.h:197
Definition bdlma_concurrentpool.h:332
Definition bdlmt_timereventscheduler.h:1085
TimerEventSchedulerTestTimeSource(TimerEventScheduler *scheduler)
bsls::TimeInterval now() const
bsls::TimeInterval advanceTime(bsls::TimeInterval amount)
Definition bdlmt_timereventscheduler.h:445
int Handle
Definition bdlmt_timereventscheduler.h:506
int rescheduleEvent(Handle handle, const bsls::TimeInterval &newTime, bool wait=false)
Definition bdlmt_timereventscheduler.h:1143
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:1152
int numClocks() const
Definition bdlmt_timereventscheduler.h:1164
void cancelAllClocks(bool wait=false)
int numEvents() const
Definition bdlmt_timereventscheduler.h:1170
TimerEventScheduler(int numEvents, int numClocks, bsls::SystemClockType::Enum clockType, const bsl::string_view &eventSchedulerName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
@ BCEP_INVALID_HANDLE
Definition bdlmt_timereventscheduler.h:518
@ e_INVALID_HANDLE
Definition bdlmt_timereventscheduler.h:516
@ INVALID_HANDLE
Definition bdlmt_timereventscheduler.h:519
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:512
int rescheduleEvent(Handle handle, const EventKey &key, const bsls::TimeInterval &newTime, bool wait=false)
bsls::TimeInterval now() const
Definition bdlmt_timereventscheduler.h:1158
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:509
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:1136
friend struct TimerEventSchedulerDispatcher
Definition bdlmt_timereventscheduler.h:623
TimerEventScheduler(int numEvents, int numClocks, bsls::SystemClockType::Enum clockType, bslma::Allocator *basicAllocator=0)
Definition bslma_bslallocator.h:588
Definition bslstl_stringview.h:471
Definition bslstl_string.h:1252
Forward declaration.
Definition bslstl_function.h:946
Definition bslstl_sharedptr.h:1838
Definition bslstl_vector.h:1120
Definition bslma_allocator.h:545
Definition bslmt_condition.h:220
Definition bslmt_mutex.h:317
Definition bslmt_threadattributes.h:361
Definition bsls_atomic.h:1490
Definition bsls_atomic.h:896
Definition bsls_atomic.h:744
Definition bsls_timeinterval.h:307
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlmt_eventscheduler.h:550
Definition bslmf_allocatorargt.h:433
Definition bslma_usesbslmaallocator.h:344
Imp::Handle Handle
Definition bslmt_threadutil.h:389
Enum
Definition bsls_systemclocktype.h:119