#include <clock_tree.h>
Public Member Functions | |
constexpr | DependentElement (ElementType &source) |
Create a dependent clock tree element that depends on source . | |
Protected Member Functions | |
Status | UpdateSource (ElementType &new_source, bool permit_change_if_in_use) |
Private Member Functions | |
Status | Acquire () final |
Status | Release () final |
Abstract class template of a clock tree element that depends on another clock tree element.
A DependentElement
clock tree element depends on another clock tree element.
Class implementations of DependentElement
must override the DoEnable
function, the DoDisable
function can be overridden to disable the dependent clock tree element to save power.
Template argument ElementType
can be of class ElementBlocking
, ElementNonBlockingCannotFail
or ElementNonBlockingMightFail.
|
inlinefinalprivate |
Acquire a reference to the dependent clock tree element.
When the first reference gets acquired, a reference to the source element gets acquired, before the dependent clock tree element gets enabled.
|
inlinefinalprivate |
Release a reference to the dependent clock tree element.
When the last reference gets released, the dependent clock tree element gets disabled (if implemented), before the reference to the source
element gets released.
|
inlineprotected |
Update source dependency.
It is the responsibility of the derived class to ensure that the source dependency can only be changed when permitted, i.e. only if reference count is zero. If the update is permitted while the reference count is greater than zero, the caller of this function must make sure that the DoEnable
method has access to the updated configuration matching the new source
dependency. Only if the UpdateSource
call succeeds, the new source has been configured as the source_
element for this element, otherwise the old source element is still configured as source_
element for this element. If the DoEnable
call of the new source fails, the current element will be disabled, since the previous source got already released, and the old source remains configured as the dependent element.