Arguments: Element element, IntegerPriority priority
Push a new element in the queue. Its priority must be greater or equal to
the highest priority present in the queue, minus one. This condition is
DCHECKed, and violating it yields erroneous queue behavior in NDEBUG mode.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003e\u003ccode\u003ePriorityQueueWithRestrictedPush\u003c/code\u003e is a C++ class offering a priority queue implementation with specific restrictions on element insertion.\u003c/p\u003e\n"],["\u003cp\u003eThe queue allows pushing elements only if their priority is within a certain range relative to the current highest priority.\u003c/p\u003e\n"],["\u003cp\u003eCore functionalities include \u003ccode\u003ePush\u003c/code\u003e, \u003ccode\u003ePop\u003c/code\u003e, \u003ccode\u003eIsEmpty\u003c/code\u003e, and \u003ccode\u003eClear\u003c/code\u003e for managing elements and queue state.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePop\u003c/code\u003e retrieves and removes the highest priority element, while \u003ccode\u003eIsEmpty\u003c/code\u003e checks if the queue is empty.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eClear\u003c/code\u003e method resets the queue to an empty state.\u003c/p\u003e\n"]]],["The `PriorityQueueWithRestrictedPush` class in C++ offers methods to manage a priority queue. Key actions include `Clear` to empty the queue, `IsEmpty` to check if it's empty, and `Pop` to retrieve and remove the highest-priority element. `Push` adds a new element with a specified priority, but it enforces a rule: the new priority must be at most one less than the current highest priority. The constructor `PriorityQueueWithRestrictedPush` initializes the class.\n"],null,["# PriorityQueueWithRestrictedPush\n\nC++ Reference: class PriorityQueueWithRestrictedPush\n====================================================\n\n\nNote: This documentation is automatically generated.\n\n| Method ||\n|-----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`Clear`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/max_flow.h#L272) | Return type: `void ` Clears the queue. |\n| [`IsEmpty`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/max_flow.h#L269) | Return type: `bool ` Is the queue empty? |\n| [`Pop`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/max_flow.h#L281) | Return type: `Element ` Returns the element with highest priority and remove it from the queue. IsEmpty() must be false, this condition is DCHECKed. |\n| [`PriorityQueueWithRestrictedPush`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/max_flow.h#L266) | \u003cbr /\u003e |\n| [`Push`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/max_flow.h#L277) | Return type: `void ` Arguments: `Element element, IntegerPriority priority` Push a new element in the queue. Its priority must be greater or equal to the highest priority present in the queue, minus one. This condition is DCHECKed, and violating it yields erroneous queue behavior in NDEBUG mode. |"]]