// // // Copyright 2015 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // #include <grpc/support/port_platform.h> #include "src/core/lib/event_engine/posix_engine/timer_heap.h" #include <stdint.h> #include <algorithm> #include "src/core/lib/event_engine/posix_engine/timer.h" namespace grpc_event_engine { namespace experimental { // Adjusts a heap so as to move a hole at position i closer to the root, // until a suitable position is found for element t. Then, copies t into that // position. This functor is called each time immediately after modifying a // value in the underlying container, with the offset of the modified element as // its argument. void TimerHeap::AdjustUpwards(size_t i, Timer* t) { … } // Adjusts a heap so as to move a hole at position i farther away from the root, // until a suitable position is found for element t. Then, copies t into that // position. void TimerHeap::AdjustDownwards(size_t i, Timer* t) { … } void TimerHeap::NoteChangedPriority(Timer* timer) { … } bool TimerHeap::Add(Timer* timer) { … } void TimerHeap::Remove(Timer* timer) { … } bool TimerHeap::is_empty() { … } Timer* TimerHeap::Top() { … } void TimerHeap::Pop() { … } } // namespace experimental } // namespace grpc_event_engine