![]() |
TrinityCore
|
#include <TaskScheduler.h>
Classes | |
| struct | Compare |
| Container which provides Task order, insert and reschedule operations. More... | |
| class | Task |
| class | TaskQueue |
Public Member Functions | |
| TaskScheduler () | |
| template<typename P > | |
| TaskScheduler (P &&predicate) | |
| TaskScheduler (TaskScheduler const &)=delete | |
| TaskScheduler (TaskScheduler &&)=delete | |
| TaskScheduler & | operator= (TaskScheduler const &)=delete |
| TaskScheduler & | operator= (TaskScheduler &&)=delete |
| template<typename P > | |
| TaskScheduler & | SetValidator (P &&predicate) |
| Sets a validator which is asked if tasks are allowed to be executed. | |
| TaskScheduler & | ClearValidator () |
| Clears the validator which is asked if tasks are allowed to be executed. | |
| TaskScheduler & | Update (success_t const &callback=EmptyCallback) |
| TaskScheduler & | Update (size_t const milliseconds, success_t const &callback=EmptyCallback) |
| template<class _Rep , class _Period > | |
| TaskScheduler & | Update (std::chrono::duration< _Rep, _Period > const &difftime, success_t const &callback=EmptyCallback) |
| TaskScheduler & | Async (std::function< void()> const &callable) |
| template<class _Rep , class _Period > | |
| TaskScheduler & | Schedule (std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task) |
| template<class _Rep , class _Period > | |
| TaskScheduler & | Schedule (std::chrono::duration< _Rep, _Period > const &time, group_t const group, task_handler_t const &task) |
| template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
| TaskScheduler & | Schedule (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max, task_handler_t const &task) |
| template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
| TaskScheduler & | Schedule (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max, group_t const group, task_handler_t const &task) |
| TaskScheduler & | CancelAll () |
| TaskScheduler & | CancelGroup (group_t const group) |
| TaskScheduler & | CancelGroupsOf (std::vector< group_t > const &groups) |
| template<class _Rep , class _Period > | |
| TaskScheduler & | DelayAll (std::chrono::duration< _Rep, _Period > const &duration) |
| Delays all tasks with the given duration. | |
| template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
| TaskScheduler & | DelayAll (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
| Delays all tasks with a random duration between min and max. | |
| template<class _Rep , class _Period > | |
| TaskScheduler & | DelayGroup (group_t const group, std::chrono::duration< _Rep, _Period > const &duration) |
| Delays all tasks of a group with the given duration. | |
| template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
| TaskScheduler & | DelayGroup (group_t const group, std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
| Delays all tasks of a group with a random duration between min and max. | |
| template<class _Rep , class _Period > | |
| TaskScheduler & | RescheduleAll (std::chrono::duration< _Rep, _Period > const &duration) |
| Reschedule all tasks with a given duration. | |
| template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
| TaskScheduler & | RescheduleAll (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
| Reschedule all tasks with a random duration between min and max. | |
| template<class _Rep , class _Period > | |
| TaskScheduler & | RescheduleGroup (group_t const group, std::chrono::duration< _Rep, _Period > const &duration) |
| Reschedule all tasks of a group with the given duration. | |
| template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
| TaskScheduler & | RescheduleGroup (group_t const group, std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
| Reschedule all tasks of a group with a random duration between min and max. | |
Private Types | |
| typedef std::chrono::steady_clock | clock_t |
| typedef clock_t::time_point | timepoint_t |
| typedef clock_t::duration | duration_t |
| typedef uint32 | group_t |
| typedef uint32 | repeated_t |
| typedef std::function< void(TaskContext)> | task_handler_t |
| typedef std::function< bool()> | predicate_t |
| typedef std::function< void()> | success_t |
| typedef std::shared_ptr< Task > | TaskContainer |
| typedef std::queue< std::function< void()> > | AsyncHolder |
Private Member Functions | |
| TaskScheduler & | InsertTask (TaskContainer task) |
| Insert a new task to the enqueued tasks. | |
| template<class _Rep , class _Period > | |
| TaskScheduler & | ScheduleAt (timepoint_t const &end, std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task) |
| template<class _Rep , class _Period > | |
| TaskScheduler & | ScheduleAt (timepoint_t const &end, std::chrono::duration< _Rep, _Period > const &time, group_t const group, task_handler_t const &task) |
| void | Dispatch (success_t const &callback) |
| Dispatch remaining tasks. | |
Static Private Member Functions | |
| static bool | EmptyValidator () |
| static void | EmptyCallback () |
Private Attributes | |
| std::shared_ptr< TaskScheduler > | self_reference |
| Contains a self reference to track if this object was deleted or not. | |
| timepoint_t | _now |
| The current time point (now) | |
| TaskQueue | _task_holder |
| The Task Queue which contains all task objects. | |
| AsyncHolder | _asyncHolder |
| predicate_t | _predicate |
Friends | |
| class | TaskContext |
The TaskScheduler class provides the ability to schedule std::function's in the near future. Use TaskScheduler::Update to update the scheduler. Popular methods are:
Definition at line 47 of file TaskScheduler.h.
|
private |
Definition at line 158 of file TaskScheduler.h.
|
private |
Definition at line 52 of file TaskScheduler.h.
|
private |
Definition at line 54 of file TaskScheduler.h.
|
private |
Definition at line 57 of file TaskScheduler.h.
|
private |
Definition at line 63 of file TaskScheduler.h.
|
private |
Definition at line 59 of file TaskScheduler.h.
|
private |
Definition at line 65 of file TaskScheduler.h.
|
private |
Definition at line 61 of file TaskScheduler.h.
|
private |
Definition at line 116 of file TaskScheduler.h.
|
private |
Definition at line 53 of file TaskScheduler.h.
|
inline |
Definition at line 176 of file TaskScheduler.h.
|
inline |
Definition at line 180 of file TaskScheduler.h.
|
delete |
|
delete |
| TaskScheduler & TaskScheduler::Async | ( | std::function< void()> const & | callable | ) |
Schedule an callable function that is executed at the next update tick. Its safe to modify the TaskScheduler from within the callable.
Definition at line 39 of file TaskScheduler.cpp.
References _asyncHolder.
Referenced by TaskContext::Async(), npc_wild_wyrm::DamageTaken(), npc_wild_wyrm::PassengerBoarded(), boss_ichoron::ScheduleTasks(), boss_moragg::ScheduleTasks(), and instance_violet_hold::instance_violet_hold_InstanceMapScript::SetData().
| TaskScheduler & TaskScheduler::CancelAll | ( | ) |
Cancels all tasks. Never call this from within a task context! Use TaskContext::CancelAll instead!
Clear the task holder
Definition at line 45 of file TaskScheduler.cpp.
References _asyncHolder, _task_holder, and TaskScheduler::TaskQueue::Clear().
Referenced by BossAI::_JustDied(), BossAI::_Reset(), TaskContext::CancelAll(), instance_violet_hold::instance_violet_hold_InstanceMapScript::CheckEventState(), npc_wild_wyrm::DamageTaken(), AdvisorBaseAI::DamageTaken(), npc_muru_portal::DoAction(), npc_earthen_ring_flamecaller::DoAction(), boss_lady_deathwhisper::EnterEvadeMode(), npc_vampiric_fiend::EnterEvadeMode(), DarkFallenAI::JustEngagedWith(), BroggokPrisionerBaseAI::JustEngagedWith(), npc_shadowmoon_channeler::JustEngagedWith(), npc_hellfire_channeler::JustEngagedWith(), npc_stone_keeper::JustReachedHome(), npc_daegarn::OnQuestAccept(), npc_dancing_flames::ReceiveEmote(), boss_vanndar::Reset(), npc_core_rager::Reset(), GuestBaseAI::Reset(), boss_dorothee::Reset(), boss_strawman::Reset(), boss_tinhead::Reset(), boss_roar::Reset(), npc_tito::Reset(), boss_high_inquisitor_whitemane::Reset(), npc_shadow_image::Reset(), npc_earthen_hallshaper_custodian::Reset(), npc_earthen_guardian::Reset(), npc_vault_warder::Reset(), npc_spirit_of_the_lynx::Reset(), npc_corrupted_lightning_totem::Reset(), MalacrassCompanionBaseAI::Reset(), npc_amanishi_hatcher::Reset(), npc_amani_dragonhawk_hatchling::Reset(), npc_ancient_wisp::Reset(), npc_lesser_doomguard::Reset(), boss_celebras_the_cursed::Reset(), boss_landslide::Reset(), boss_noxxion::Reset(), boss_princess_theradras::Reset(), npc_anubarak_anub_ar_assassin::Reset(), npc_anubarak_anub_ar_guardian::Reset(), npc_anubarak_anub_ar_venomancer::Reset(), npc_open_portal_target_toc::Reset(), npc_drakkari_gutripper::Reset(), npc_drakkari_scytheclaw::Reset(), npc_living_mojo::Reset(), npc_slad_ran_constrictor::Reset(), npc_slad_ran_viper::Reset(), npc_cult_fanatic::Reset(), npc_cult_adherent::Reset(), DarkFallenAI::Reset(), CoolestFriendBaseAI::Reset(), npc_expedition_engineer::Reset(), npc_scrapbot::Reset(), npc_pummeller::Reset(), npc_boombot::Reset(), npc_life_spark::Reset(), npc_erekem_guard::Reset(), npc_ethereal_sphere::Reset(), npc_azure_saboteur::Reset(), violet_hold_trashAI::Reset(), npc_daegarn::Reset(), npc_wild_wyrm::Reset(), npc_stolen_soul::Reset(), npc_yor::Reset(), npc_angered_soul_fragment::Reset(), npc_doom_blossom::Reset(), npc_shadowy_construct::Reset(), npc_fathomlord_karathress_cyclone::Reset(), npc_enchanted_elemental::Reset(), npc_tainted_elemental::Reset(), npc_shadow_of_leotheras::Reset(), npc_greyheart_spellbinder::Reset(), npc_inner_demon::Reset(), npc_coilfang_ambusher::Reset(), npc_coilfang_guardian::Reset(), npc_coilfang_waterelemental::Reset(), npc_steamrigger_mechanic::Reset(), OgreBaseAI::Reset(), BroggokPrisionerBaseAI::Reset(), npc_shadowmoon_channeler::Reset(), npc_hellfire_channeler::Reset(), npc_fel_orc_convert::Reset(), boss_harbinger_skyriss_illusion::Reset(), npc_solarium_priest::Reset(), AdvisorBaseAI::Reset(), npc_kaelthas_controller::Reset(), npc_raging_flames::Reset(), npc_nether_wraith::Reset(), npc_nagrand_banner::npc_nagrand_bannerAI::Reset(), npc_guard_generic::Reset(), npc_guard_shattrath_faction::Reset(), npc_icc_orb_controller::SetGUID(), and boss_attumen::boss_attumenAI::SpellHit().
| TaskScheduler & TaskScheduler::CancelGroup | ( | group_t const | group | ) |
Cancel all tasks of a single group. Never call this from within a task context! Use TaskContext::CancelGroup instead!
Definition at line 53 of file TaskScheduler.cpp.
References _task_holder, and TaskScheduler::TaskQueue::RemoveIf().
Referenced by TaskContext::CancelGroup(), CancelGroupsOf(), boss_slad_ran::DamageTaken(), boss_lady_deathwhisper::DamageTaken(), npc_pet_dk_rune_weapon::EnterEvadeMode(), npc_angered_soul_fragment::JustEngagedWith(), and boss_lady_deathwhisper::JustEngagedWith().
| TaskScheduler & TaskScheduler::CancelGroupsOf | ( | std::vector< group_t > const & | groups | ) |
Cancels all groups in the given std::vector. Hint: Use std::initializer_list for this: "{1, 2, 3, 4}"
Definition at line 62 of file TaskScheduler.cpp.
References CancelGroup().
Referenced by TaskContext::CancelGroupsOf().
| TaskScheduler & TaskScheduler::ClearValidator | ( | ) |
Clears the validator which is asked if tasks are allowed to be executed.
Definition at line 21 of file TaskScheduler.cpp.
References _predicate, and EmptyValidator().
|
inline |
Delays all tasks with the given duration.
Definition at line 273 of file TaskScheduler.h.
References TaskScheduler::TaskQueue::ModifyIf().
Referenced by boss_ichoron::DoAction().
|
inline |
Delays all tasks with a random duration between min and max.
Definition at line 285 of file TaskScheduler.h.
References randtime().
|
inline |
Delays all tasks of a group with the given duration.
Definition at line 293 of file TaskScheduler.h.
References TaskScheduler::TaskQueue::ModifyIf().
|
inline |
Delays all tasks of a group with a random duration between min and max.
Definition at line 310 of file TaskScheduler.h.
References randtime().
|
private |
Dispatch remaining tasks.
Definition at line 76 of file TaskScheduler.cpp.
References _asyncHolder, _now, _predicate, _task_holder, TaskScheduler::TaskQueue::First(), TaskContext::Invoke(), TaskScheduler::TaskQueue::IsEmpty(), TaskScheduler::TaskQueue::Pop(), and self_reference.
Referenced by TaskContext::Async(), TaskContext::CancelAll(), TaskContext::CancelGroup(), TaskContext::CancelGroupsOf(), and Update().
|
inlinestaticprivate |
Definition at line 171 of file TaskScheduler.h.
|
inlinestaticprivate |
Definition at line 166 of file TaskScheduler.h.
Referenced by ClearValidator().
|
private |
Insert a new task to the enqueued tasks.
Definition at line 70 of file TaskScheduler.cpp.
References _task_holder, and TaskScheduler::TaskQueue::Push().
Referenced by TaskContext::Repeat().
|
delete |
|
delete |
|
inline |
Reschedule all tasks with a given duration.
Definition at line 319 of file TaskScheduler.h.
References TaskScheduler::TaskQueue::ModifyIf().
Referenced by TaskContext::RescheduleAll().
|
inline |
Reschedule all tasks with a random duration between min and max.
Definition at line 332 of file TaskScheduler.h.
References randtime().
|
inline |
Reschedule all tasks of a group with the given duration.
Definition at line 340 of file TaskScheduler.h.
References TaskScheduler::TaskQueue::ModifyIf().
|
inline |
Reschedule all tasks of a group with a random duration between min and max.
Definition at line 358 of file TaskScheduler.h.
References randtime().
|
inline |
Schedule an event with a fixed rate. Never call this from within a task context! Use TaskContext::Schedule instead!
Definition at line 234 of file TaskScheduler.h.
|
inline |
Schedule an event with a fixed rate. Never call this from within a task context! Use TaskContext::Schedule instead!
Definition at line 225 of file TaskScheduler.h.
Referenced by npc_elwynn_forest_wolf::_ScheduleAfterChasingEvents(), npc_elwynn_forest_wolf::_ScheduleBeforeChasingEvents(), npc_expedition_engineer::ChangeOrientation(), boss_slad_ran::DamageTaken(), npc_core_rager::DamageTaken(), boss_landslide::DamageTaken(), boss_lady_deathwhisper::DamageTaken(), npc_flash_freeze_init::DamageTaken(), npc_flash_freeze_combat::DamageTaken(), npc_frost_tomb::DamageTaken(), boss_hungarfen::DamageTaken(), boss_high_king_maulgar::DamageTaken(), AdvisorBaseAI::DamageTaken(), npc_phoenix_the_eye::DamageTaken(), npc_barnes::DoAction(), npc_vault_warder::DoAction(), npc_orb_carrier::DoAction(), boss_lady_deathwhisper::DoAction(), CoolestFriendBaseAI::DoAction(), boss_skadi::DoAction(), npc_parasitic_shadowfiend::DoAction(), npc_earthen_ring_flamecaller::DoAction(), npc_omrogg_heads::DoAction(), npc_kaelthas_controller::DoAction(), npc_expedition_trapper::DoAction(), npc_expedition_engineer::DoAction(), npc_pulsing_pumpkin::DoAction(), npc_shadowmoon_channeler::DoCastChanneledSpell(), BroggokPrisionerBaseAI::DoStartEmotesTask(), go_empowering_blood_orb::HandleObjectUse(), npc_fallout_slime::InitializeAI(), npc_underbog_mushroom::InitializeAI(), npc_living_inferno::IsSummonedBy(), boss_attumen::boss_attumenAI::IsSummonedBy(), npc_rizzle_sprysprocket::IsSummonedBy(), npc_pit_of_saron_icicle::IsSummonedBy(), npc_pet_dk_rune_weapon::IsSummonedBy(), boss_dorothee::JustAppeared(), boss_strawman::JustAppeared(), boss_tinhead::JustAppeared(), boss_roar::JustAppeared(), boss_crone::JustAppeared(), boss_big_bad_wolf::JustAppeared(), npc_shadow_image::JustAppeared(), npc_void_sentinel_summoner::JustAppeared(), npc_void_sentinel::JustAppeared(), npc_void_spawn::JustAppeared(), npc_dark_fiend::JustAppeared(), npc_darkness::JustAppeared(), npc_singularity::JustAppeared(), npc_soaring_eagle::JustAppeared(), npc_spirit_of_the_lynx::JustAppeared(), npc_corrupted_lightning_totem::JustAppeared(), npc_zuljin_vortex::JustAppeared(), npc_towering_infernal::JustAppeared(), npc_doomfire::JustAppeared(), npc_doomfire_spirit::JustAppeared(), npc_kelthuzad_shadow_fissure::JustAppeared(), npc_icicle::JustAppeared(), npc_flash_freeze_init::JustAppeared(), npc_flash_freeze_combat::JustAppeared(), npc_xt_void_zone::JustAppeared(), npc_ingvar_throw_dummy::JustAppeared(), npc_yor::JustAppeared(), npc_brood_of_anzu::JustAppeared(), npc_voidwalker_summoner::JustAppeared(), npc_void_traveler::JustAppeared(), npc_fathomlord_karathress_cyclone::JustAppeared(), npc_enchanted_elemental::JustAppeared(), npc_shadow_of_leotheras::JustAppeared(), npc_water_globule::JustAppeared(), npc_ahune_ice_spear_bunny::JustAppeared(), npc_hellfire_channeler::JustAppeared(), npc_magtheridon_room::JustAppeared(), npc_warchiefs_portal::JustAppeared(), npc_ember_of_alar::JustAppeared(), npc_phoenix_the_eye::JustAppeared(), boss_vanndar::JustEngagedWith(), npc_core_rager::JustEngagedWith(), boss_crone::JustEngagedWith(), npc_tito::JustEngagedWith(), boss_high_inquisitor_whitemane::JustEngagedWith(), npc_shadow_image::JustEngagedWith(), npc_void_sentinel::JustEngagedWith(), npc_void_spawn::JustEngagedWith(), npc_earthen_hallshaper_custodian::JustEngagedWith(), npc_earthen_guardian::JustEngagedWith(), npc_vault_warder::JustEngagedWith(), npc_stone_keeper::JustEngagedWith(), npc_spirit_of_the_lynx::JustEngagedWith(), npc_amani_dragonhawk_hatchling::JustEngagedWith(), npc_ancient_wisp::JustEngagedWith(), npc_lesser_doomguard::JustEngagedWith(), npc_anubarak_anub_ar_assassin::JustEngagedWith(), npc_anubarak_anub_ar_guardian::JustEngagedWith(), npc_anubarak_anub_ar_venomancer::JustEngagedWith(), npc_drakkari_gutripper::JustEngagedWith(), npc_drakkari_scytheclaw::JustEngagedWith(), npc_living_mojo::JustEngagedWith(), npc_slad_ran_constrictor::JustEngagedWith(), npc_slad_ran_viper::JustEngagedWith(), npc_vampiric_fiend::JustEngagedWith(), npc_iron_sludge::JustEngagedWith(), npc_life_spark::JustEngagedWith(), npc_stolen_soul::JustEngagedWith(), npc_yor::JustEngagedWith(), npc_angered_soul_fragment::JustEngagedWith(), npc_shadow_of_leotheras::JustEngagedWith(), npc_inner_demon::JustEngagedWith(), npc_coilfang_ambusher::JustEngagedWith(), npc_coilfang_guardian::JustEngagedWith(), npc_coilfang_waterelemental::JustEngagedWith(), npc_steamrigger_mechanic::JustEngagedWith(), npc_fel_orc_convert::JustEngagedWith(), npc_raging_flames::JustEngagedWith(), npc_nether_wraith::JustEngagedWith(), npc_nagrand_banner::npc_kil_sorrow_spellbinderAI::JustEngagedWith(), npc_nagrand_banner::npc_kil_sorrow_cultistAI::JustEngagedWith(), npc_nagrand_banner::npc_warmaul_shamanAI::JustEngagedWith(), boss_midnight::boss_midnightAI::JustEngagedWith(), boss_big_bad_wolf::JustEngagedWith(), npc_dark_nucleus::JustEngagedWith(), boss_lady_deathwhisper::JustEngagedWith(), boss_hungarfen::JustEngagedWith(), boss_high_king_maulgar::JustEngagedWith(), npc_guard_generic::JustEngagedWith(), npc_pet_dk_rune_weapon::JustEnteredCombat(), npc_ashtongue_sorcerer::MoveInLineOfSight(), boss_high_inquisitor_whitemane::MovementInform(), npc_amanishi_hatcher::MovementInform(), npc_ball_of_flame::MovementInform(), npc_ingvar_throw_dummy::MovementInform(), npc_twilight_volunteer::MovementInform(), npc_expedition_engineer::MovementInform(), npc_grauf::MovementInform(), npc_skadi_trashAI::MovementInform(), npc_azure_saboteur::MovementInform(), npc_daegarn::OnQuestAccept(), npc_grauf::PassengerBoarded(), npc_dancing_flames::ReceiveEmote(), go_direbrew_mole_machine::go_direbrew_mole_machineAI::Reset(), npc_curator_astral_flare::npc_curator_astral_flareAI::Reset(), npc_kilrek::npc_kilrekAI::Reset(), npc_fiendish_portal::npc_fiendish_portalAI::Reset(), npc_fiendish_imp::npc_fiendish_impAI::Reset(), npc_flame_bunny::Reset(), npc_sir_thomas::Reset(), npc_amanitar_mushrooms::Reset(), npc_fel_infernal::Reset(), npc_vengeful_shade::Reset(), npc_icc_orb_controller::Reset(), DarkFallenAI::Reset(), npc_sapphiron_blizzard::Reset(), npc_swarming_guardian::Reset(), go_razorscale_harpoon::go_razorscale_harpoonAI::Reset(), go_razorscale_mole_machine::go_razorscale_mole_machineAI::Reset(), npc_scrapbot::Reset(), npc_azure_saboteur::Reset(), npc_daegarn::Reset(), npc_angered_soul_fragment::Reset(), npc_parasitic_shadowfiend::Reset(), npc_blade_of_azzinoth::Reset(), npc_shadow_demon::Reset(), npc_cage_trap_trigger::Reset(), npc_veras_vanish_effect::Reset(), npc_enslaved_soul::Reset(), npc_ashtongue_channeler::Reset(), npc_volcano::Reset(), npc_doom_blossom::Reset(), npc_shadowy_construct::Reset(), go_ahune_ice_spear::Reset(), go_vazruden_liquid_fire::Reset(), npc_guard_generic::Reset(), npc_torch_tossing_target_bunny_controller::npc_torch_tossing_target_bunny_controllerAI::Reset(), instance_violet_hold::instance_violet_hold_InstanceMapScript::ScheduleCyanigosaIntro(), npc_erekem_guard::ScheduledTasks(), npc_ethereal_sphere::ScheduledTasks(), npc_violet_hold_defense_system::ScheduledTasks(), npc_azure_invader::ScheduledTasks(), npc_azure_binder::ScheduledTasks(), npc_azure_mage_slayer::ScheduledTasks(), npc_azure_raider::ScheduledTasks(), npc_azure_stalker::ScheduledTasks(), npc_azure_spellbreaker::ScheduledTasks(), npc_azure_captain::ScheduledTasks(), npc_azure_sorceror::ScheduledTasks(), boss_baroness_dorothea_millstipe::ScheduleEvents(), boss_baron_rafe_dreuger::ScheduleEvents(), boss_lady_catriona_von_indi::ScheduleEvents(), boss_lady_keira_berrybuck::ScheduleEvents(), boss_lord_robin_daris::ScheduleEvents(), boss_lord_crispin_ference::ScheduleEvents(), npc_shadowsword_berserker::ScheduleEvents(), npc_shadowsword_fury_mage::ScheduleEvents(), boss_alyson_antille::ScheduleEvents(), boss_thurg::ScheduleEvents(), boss_slither::ScheduleEvents(), boss_lord_raadan::ScheduleEvents(), boss_gazakroth::ScheduleEvents(), boss_fenstalker::ScheduleEvents(), boss_darkheart::ScheduleEvents(), boss_koragg::ScheduleEvents(), npc_hodir_priest::ScheduleEvents(), npc_hodir_shaman::ScheduleEvents(), npc_hodir_druid::ScheduleEvents(), npc_hodir_mage::ScheduleEvents(), boss_olm_the_summoner::ScheduleEvents(), boss_kiggler_the_crazed::ScheduleEvents(), boss_blindeye_the_seer::ScheduleEvents(), boss_krosh_firehand::ScheduleEvents(), npc_nascent_fel_orc::ScheduleEvents(), npc_fel_orc_neophyte::ScheduleEvents(), boss_thaladred_the_darkener::ScheduleEvents(), boss_lord_sanguinar::ScheduleEvents(), boss_grand_astromancer_capernian::ScheduleEvents(), boss_master_engineer_telonicus::ScheduleEvents(), npc_sinclari_vh::ScheduleIntro(), npc_darkfallen_blood_knight::ScheduleSpells(), npc_darkfallen_noble::ScheduleSpells(), npc_darkfallen_archmage::ScheduleSpells(), npc_darkfallen_advisor::ScheduleSpells(), npc_darkfallen_tactician::ScheduleSpells(), boss_attumen::boss_attumenAI::ScheduleTasks(), boss_volazj::ScheduleTasks(), boss_slad_ran::ScheduleTasks(), npc_ymirjar_warrior::ScheduleTasks(), npc_ymirjar_witch_doctor::ScheduleTasks(), npc_ymirjar_harpooner::ScheduleTasks(), boss_cyanigosa::ScheduleTasks(), boss_erekem::ScheduleTasks(), boss_ichoron::ScheduleTasks(), boss_lavanthor::ScheduleTasks(), boss_moragg::ScheduleTasks(), boss_xevozz::ScheduleTasks(), boss_zuramat::ScheduleTasks(), npc_violet_hold_teleportation_portal_elite::ScheduleTasks(), npc_violet_hold_teleportation_portal_intro::ScheduleTasks(), npc_guard_shattrath_faction::ScheduleVanish(), npc_icc_orb_controller::ScheduleVisualChannel(), npc_twisted_visage::SetData(), instance_violet_hold::instance_violet_hold_InstanceMapScript::SetData(), boss_attumen::boss_attumenAI::SpellHit(), boss_scarlet_commander_mograine::SpellHit(), npc_muru_portal::SpellHit(), npc_earthen_hallshaper_custodian::SpellHit(), npc_earthen_guardian::SpellHit(), npc_vault_warder::SpellHit(), npc_zuljin_spirit::SpellHit(), npc_open_portal_target_toc::SpellHit(), npc_cult_fanatic::SpellHit(), npc_cult_adherent::SpellHit(), AdvisorBaseAI::SpellHit(), npc_dark_fiend::SpellHitTarget(), npc_malformed_ooze::SpellHitTarget(), instance_violet_hold::instance_violet_hold_InstanceMapScript::StartBossEncounter(), npc_barnes::WaypointPathEnded(), npc_earthen_ring_flamecaller::WaypointPathEnded(), violet_hold_trashAI::WaypointReached(), and npc_rizzle_sprysprocket::WaypointStarted().
|
inline |
Schedule an event with a fixed rate. Never call this from within a task context! Use TaskContext::Schedule instead!
Definition at line 252 of file TaskScheduler.h.
References randtime().
|
inline |
Schedule an event with a randomized rate between min and max rate. Never call this from within a task context! Use TaskContext::Schedule instead!
Definition at line 243 of file TaskScheduler.h.
References randtime().
|
inlineprivate |
Schedule an event with a fixed rate. Never call this from within a task context! Use TaskContext::schedule instead!
Definition at line 379 of file TaskScheduler.h.
|
inlineprivate |
Definition at line 370 of file TaskScheduler.h.
Referenced by TaskContext::Schedule(), and TaskContext::Schedule().
|
inline |
Sets a validator which is asked if tasks are allowed to be executed.
Definition at line 190 of file TaskScheduler.h.
Referenced by BossAI::BossAI(), boss_lady_deathwhisper::Initialize(), boss_skadi::Initialize(), MalacrassCompanionBaseAI::InitializeAI(), CoolestFriendBaseAI::InitializeAI(), AdvisorBaseAI::InitializeAI(), ShadowswordBaseAI::JustAppeared(), npc_focus_fire::JustAppeared(), npc_blackheart_the_inciter_dummy::JustAppeared(), npc_tainted_elemental::JustAppeared(), boss_harbinger_skyriss_illusion::JustAppeared(), npc_coren_direbrew_sisters::JustEngagedWith(), boss_dorothee::JustEngagedWith(), boss_strawman::JustEngagedWith(), boss_tinhead::JustEngagedWith(), boss_roar::JustEngagedWith(), boss_celebras_the_cursed::JustEngagedWith(), boss_landslide::JustEngagedWith(), boss_noxxion::JustEngagedWith(), boss_princess_theradras::JustEngagedWith(), npc_greyheart_spellbinder::JustEngagedWith(), npc_shadowmoon_channeler::JustEngagedWith(), npc_hellfire_channeler::JustEngagedWith(), npc_solarium_priest::JustEngagedWith(), npc_erekem_guard::npc_erekem_guard(), npc_guard_generic::npc_guard_generic(), npc_guard_shattrath_faction::npc_guard_shattrath_faction(), npc_nagrand_banner::npc_nagrand_bannerAI::npc_nagrand_bannerAI(), npc_skadi_trashAI::npc_skadi_trashAI(), GuestBaseAI::Reset(), npc_twisted_visage::Reset(), npc_fel_infernal::Reset(), npc_cult_fanatic::Reset(), npc_cult_adherent::Reset(), DarkFallenAI::Reset(), OgreBaseAI::Reset(), and violet_hold_trashAI::violet_hold_trashAI().
| TaskScheduler & TaskScheduler::Update | ( | size_t const | milliseconds, |
| success_t const & | callback = EmptyCallback |
||
| ) |
Update the scheduler with a difftime in ms. Calls the optional callback on successfully finish.
Definition at line 34 of file TaskScheduler.cpp.
References Update().
|
inline |
Update the scheduler with a difftime. Calls the optional callback on successfully finish.
Definition at line 210 of file TaskScheduler.h.
| TaskScheduler & TaskScheduler::Update | ( | success_t const & | callback = EmptyCallback | ) |
Update the scheduler to the current time. Calls the optional callback on successfully finish.
Definition at line 27 of file TaskScheduler.cpp.
References _now, and Dispatch().
Referenced by Update(), instance_violet_hold::instance_violet_hold_InstanceMapScript::Update(), boss_high_inquisitor_whitemane::UpdateAI(), boss_vanndar::UpdateAI(), npc_coren_direbrew_sisters::UpdateAI(), go_direbrew_mole_machine::go_direbrew_mole_machineAI::UpdateAI(), npc_core_rager::UpdateAI(), npc_curator_astral_flare::npc_curator_astral_flareAI::UpdateAI(), boss_attumen::boss_attumenAI::UpdateAI(), boss_midnight::boss_midnightAI::UpdateAI(), GuestBaseAI::UpdateAI(), npc_kilrek::npc_kilrekAI::UpdateAI(), npc_fiendish_portal::npc_fiendish_portalAI::UpdateAI(), npc_fiendish_imp::npc_fiendish_impAI::UpdateAI(), boss_dorothee::UpdateAI(), boss_strawman::UpdateAI(), boss_tinhead::UpdateAI(), boss_roar::UpdateAI(), boss_crone::UpdateAI(), npc_tito::UpdateAI(), boss_big_bad_wolf::UpdateAI(), npc_barnes::UpdateAI(), npc_pulsing_pumpkin::UpdateAI(), npc_flame_bunny::UpdateAI(), npc_sir_thomas::UpdateAI(), boss_scarlet_commander_mograine::UpdateAI(), npc_shadow_image::UpdateAI(), npc_muru_portal::UpdateAI(), npc_void_sentinel_summoner::UpdateAI(), npc_void_sentinel::UpdateAI(), npc_void_spawn::UpdateAI(), npc_dark_fiend::UpdateAI(), npc_darkness::UpdateAI(), npc_singularity::UpdateAI(), ShadowswordBaseAI::UpdateAI(), npc_earthen_hallshaper_custodian::UpdateAI(), npc_earthen_guardian::UpdateAI(), npc_vault_warder::UpdateAI(), npc_stone_keeper::UpdateAI(), npc_soaring_eagle::UpdateAI(), npc_spirit_of_the_lynx::UpdateAI(), npc_corrupted_lightning_totem::UpdateAI(), MalacrassCompanionBaseAI::UpdateAI(), npc_amanishi_hatcher::UpdateAI(), npc_amani_dragonhawk_hatchling::UpdateAI(), npc_zuljin_vortex::UpdateAI(), npc_zuljin_spirit::UpdateAI(), npc_towering_infernal::UpdateAI(), npc_doomfire::UpdateAI(), npc_doomfire_spirit::UpdateAI(), npc_ancient_wisp::UpdateAI(), npc_lesser_doomguard::UpdateAI(), boss_celebras_the_cursed::UpdateAI(), boss_landslide::UpdateAI(), boss_noxxion::UpdateAI(), boss_princess_theradras::UpdateAI(), npc_rizzle_sprysprocket::UpdateAI(), npc_amanitar_mushrooms::UpdateAI(), boss_volazj::UpdateAI(), npc_twisted_visage::UpdateAI(), npc_twilight_volunteer::UpdateAI(), npc_anubarak_anub_ar_assassin::UpdateAI(), npc_anubarak_anub_ar_guardian::UpdateAI(), npc_anubarak_anub_ar_venomancer::UpdateAI(), npc_orb_carrier::UpdateAI(), npc_living_inferno::UpdateAI(), npc_fel_infernal::UpdateAI(), npc_open_portal_target_toc::UpdateAI(), npc_drakkari_gutripper::UpdateAI(), npc_drakkari_scytheclaw::UpdateAI(), npc_pit_of_saron_icicle::UpdateAI(), npc_living_mojo::UpdateAI(), boss_slad_ran::UpdateAI(), npc_slad_ran_constrictor::UpdateAI(), npc_slad_ran_viper::UpdateAI(), npc_ball_of_flame::UpdateAI(), npc_dark_nucleus::UpdateAI(), boss_lady_deathwhisper::UpdateAI(), npc_cult_fanatic::UpdateAI(), npc_cult_adherent::UpdateAI(), npc_vengeful_shade::UpdateAI(), npc_icc_orb_controller::UpdateAI(), DarkFallenAI::UpdateAI(), npc_vampiric_fiend::UpdateAI(), go_empowering_blood_orb::UpdateAI(), npc_fallout_slime::UpdateAI(), npc_kelthuzad_shadow_fissure::UpdateAI(), npc_sapphiron_blizzard::UpdateAI(), npc_malformed_ooze::UpdateAI(), npc_iron_sludge::UpdateAI(), npc_swarming_guardian::UpdateAI(), CoolestFriendBaseAI::UpdateAI(), npc_icicle::UpdateAI(), npc_flash_freeze_init::UpdateAI(), npc_flash_freeze_combat::UpdateAI(), npc_expedition_trapper::UpdateAI(), npc_expedition_engineer::UpdateAI(), npc_razorscale_spawner::UpdateAI(), go_razorscale_harpoon::go_razorscale_harpoonAI::UpdateAI(), go_razorscale_mole_machine::go_razorscale_mole_machineAI::UpdateAI(), npc_scrapbot::UpdateAI(), npc_pummeller::UpdateAI(), npc_boombot::UpdateAI(), npc_life_spark::UpdateAI(), npc_xt_void_zone::UpdateAI(), npc_ingvar_throw_dummy::UpdateAI(), npc_frost_tomb::UpdateAI(), boss_skadi::UpdateAI(), npc_grauf::UpdateAI(), npc_skadi_trashAI::UpdateAI(), boss_cyanigosa::UpdateAI(), boss_erekem::UpdateAI(), npc_erekem_guard::UpdateAI(), boss_ichoron::UpdateAI(), boss_lavanthor::UpdateAI(), boss_moragg::UpdateAI(), boss_xevozz::UpdateAI(), npc_ethereal_sphere::UpdateAI(), boss_zuramat::UpdateAI(), npc_sinclari_vh::UpdateAI(), npc_azure_saboteur::UpdateAI(), npc_violet_hold_teleportation_portal_commonAI::UpdateAI(), npc_violet_hold_defense_system::UpdateAI(), npc_daegarn::UpdateAI(), npc_stolen_soul::UpdateAI(), npc_focus_fire::UpdateAI(), npc_yor::UpdateAI(), npc_brood_of_anzu::UpdateAI(), npc_blackheart_the_inciter_dummy::UpdateAI(), npc_voidwalker_summoner::UpdateAI(), npc_angered_soul_fragment::UpdateAI(), npc_parasitic_shadowfiend::UpdateAI(), npc_blade_of_azzinoth::UpdateAI(), npc_shadow_demon::UpdateAI(), npc_cage_trap_trigger::UpdateAI(), npc_veras_vanish_effect::UpdateAI(), npc_enslaved_soul::UpdateAI(), npc_ashtongue_channeler::UpdateAI(), npc_volcano::UpdateAI(), npc_doom_blossom::UpdateAI(), npc_shadowy_construct::UpdateAI(), npc_fathomlord_karathress_cyclone::UpdateAI(), npc_enchanted_elemental::UpdateAI(), npc_tainted_elemental::UpdateAI(), npc_shadow_of_leotheras::UpdateAI(), npc_greyheart_spellbinder::UpdateAI(), npc_inner_demon::UpdateAI(), npc_coilfang_ambusher::UpdateAI(), npc_coilfang_guardian::UpdateAI(), npc_water_globule::UpdateAI(), npc_coilfang_waterelemental::UpdateAI(), npc_steamrigger_mechanic::UpdateAI(), npc_earthen_ring_flamecaller::UpdateAI(), npc_ahune_ice_spear_bunny::UpdateAI(), go_ahune_ice_spear::UpdateAI(), boss_hungarfen::UpdateAI(), npc_underbog_mushroom::UpdateAI(), boss_high_king_maulgar::UpdateAI(), OgreBaseAI::UpdateAI(), BroggokPrisionerBaseAI::UpdateAI(), npc_shadowmoon_channeler::UpdateAI(), go_vazruden_liquid_fire::UpdateAI(), npc_hellfire_channeler::UpdateAI(), npc_magtheridon_room::UpdateAI(), npc_fel_orc_convert::UpdateAI(), npc_omrogg_heads::UpdateAI(), npc_warchiefs_portal::UpdateAI(), boss_harbinger_skyriss_illusion::UpdateAI(), npc_ember_of_alar::UpdateAI(), npc_solarium_priest::UpdateAI(), AdvisorBaseAI::UpdateAI(), npc_kaelthas_controller::UpdateAI(), npc_phoenix_the_eye::UpdateAI(), npc_raging_flames::UpdateAI(), npc_nether_wraith::UpdateAI(), npc_nagrand_banner::npc_nagrand_bannerAI::UpdateAI(), npc_nagrand_banner::npc_kil_sorrow_spellbinderAI::UpdateAI(), npc_pet_dk_rune_weapon::UpdateAI(), npc_elwynn_forest_wolf::UpdateAI(), npc_guard_generic::UpdateAI(), npc_guard_shattrath_faction::UpdateAI(), npc_dancing_flames::UpdateAI(), npc_torch_tossing_target_bunny_controller::npc_torch_tossing_target_bunny_controllerAI::UpdateAI(), and violet_hold_trashAI::UpdateEscortAI().
|
friend |
Definition at line 49 of file TaskScheduler.h.
|
private |
Contains all asynchronous tasks which will be invoked at the next update tick.
Definition at line 162 of file TaskScheduler.h.
Referenced by Async(), CancelAll(), and Dispatch().
|
private |
The current time point (now)
Definition at line 153 of file TaskScheduler.h.
Referenced by Dispatch(), and Update().
|
private |
Definition at line 164 of file TaskScheduler.h.
Referenced by ClearValidator(), and Dispatch().
|
private |
The Task Queue which contains all task objects.
Definition at line 156 of file TaskScheduler.h.
Referenced by CancelAll(), CancelGroup(), Dispatch(), and InsertTask().
|
private |
Contains a self reference to track if this object was deleted or not.
Definition at line 150 of file TaskScheduler.h.
Referenced by Dispatch().