void WIDomainPerformanceControlCapabilityChanged::execute(void)
{
	writeDomainWorkItemStartingInfoMessage();

	try
	{
		getParticipantPtr()->domainPerformanceControlCapabilityChanged();
	}
	catch (std::exception& ex)
	{
		writeDomainWorkItemErrorMessage(ex, "Participant::domainPerformanceControlCapabilityChanged");
	}

	auto policyManager = getPolicyManager();
	auto policyIndexes = policyManager->getPolicyIndexes();

	for (auto i = policyIndexes.begin(); i != policyIndexes.end(); ++i)
	{
		try
		{
			Policy* policy = policyManager->getPolicyPtr(*i);
			policy->executeDomainPerformanceControlCapabilityChanged(getParticipantIndex());
		}
		catch (policy_index_invalid& ex)
		{
			// do nothing.  No item in the policy list at this index.
		}
		catch (std::exception& ex)
		{
			writeDomainWorkItemErrorMessagePolicy(ex, "Policy::executeDomainPerformanceControlCapabilityChanged", *i);
		}
	}
}
Beispiel #2
0
void WIDomainPlatformRestOfPowerChanged::execute(void)
{
    writeDomainWorkItemStartingInfoMessage();

    try
    {
        getParticipantPtr()->domainPlatformRestOfPowerChanged();
    }
    catch (std::exception& ex)
    {
        writeDomainWorkItemErrorMessage(ex, "Participant::domainPlatformRestOfPowerChanged");
    }

    auto policyManager = getPolicyManager();
    UIntN policyListCount = policyManager->getPolicyListCount();

    for (UIntN i = 0; i < policyListCount; i++)
    {
        try
        {
            Policy* policy = policyManager->getPolicyPtr(i);
            policy->executeDomainPlatformRestOfPowerChanged(getParticipantIndex());
        }
        catch (policy_index_invalid ex)
        {
            // do nothing.  No item in the policy list at this index.
        }
        catch (std::exception& ex)
        {
            writeDomainWorkItemErrorMessagePolicy(ex, "Policy::executeDomainPlatformRestOfPowerChanged", i);
        }
    }
}
Beispiel #3
0
void WIPolicyPowerBossConditionsTableChanged::execute(void)
{
    writeWorkItemStartingInfoMessage();

    auto policyManager = getPolicyManager();
    UIntN policyListCount = policyManager->getPolicyListCount();

    for (UIntN i = 0; i < policyListCount; i++)
    {
        try
        {
            Policy* policy = policyManager->getPolicyPtr(i);
            policy->executePolicyPowerBossConditionsTableChanged();
        }
        catch (policy_index_invalid ex)
        {
            // do nothing.  No item in the policy list at this index.
        }
        catch (std::exception& ex)
        {
            writeWorkItemErrorMessagePolicy(ex, 
                "Policy::executePolicyPowerBossConditionsTableChanged", i);
        }
    }
}
void WIPolicyOperatingSystemPlatformTypeChanged::execute(void)
{
	writeWorkItemStartingInfoMessage();

	auto policyManager = getPolicyManager();
	auto policyIndexes = policyManager->getPolicyIndexes();

	for (auto i = policyIndexes.begin(); i != policyIndexes.end(); ++i)
	{
		try
		{
			getDptfManager()->getEventCache()->platformType.set(m_platformType);
			Policy* policy = policyManager->getPolicyPtr(*i);
			policy->executePolicyOperatingSystemPlatformTypeChanged(m_platformType);
		}
		catch (policy_index_invalid& ex)
		{
			// do nothing.  No item in the policy list at this index.
		}
		catch (std::exception& ex)
		{
			writeWorkItemErrorMessagePolicy(ex, "Policy::executePolicyOperatingSystemPlatformTypeChanged", *i);
		}
	}
}
void WIDptfConnectedStandbyEntry::execute(void)
{
	writeWorkItemStartingInfoMessage();

	// First let all policies know that we are entering connected standby

	auto policyManager = getPolicyManager();
	auto policyIndexes = policyManager->getPolicyIndexes();

	for (auto i = policyIndexes.begin(); i != policyIndexes.end(); ++i)
	{
		try
		{
			Policy* policy = policyManager->getPolicyPtr(*i);
			policy->executeConnectedStandbyEntry();
		}
		catch (policy_index_invalid& ex)
		{
			// do nothing.  No item in the policy list at this index.
		}
		catch (std::exception& ex)
		{
			writeWorkItemErrorMessagePolicy(ex, "Policy::executeConnectedStandbyEntry", *i);
		}
	}

	// Now let all participants know

	auto participantManager = getParticipantManager();
	auto participantIndexList = participantManager->getParticipantIndexes();

	for (auto i = participantIndexList.begin(); i != participantIndexList.end(); ++i)
	{
		try
		{
			Participant* participant = participantManager->getParticipantPtr(*i);
			participant->connectedStandbyEntry();
		}
		catch (participant_index_invalid& ex)
		{
			// do nothing.  No item in the participant list at this index.
		}
		catch (std::exception& ex)
		{
			writeWorkItemErrorMessageParticipant(ex, "Participant::connectedStandbyEntry", *i);
		}
	}
}
Beispiel #6
0
void WIDomainCreate::execute(void)
{
    writeDomainWorkItemStartingInfoMessage();

    Bool domainCreated = false;

    try
    {
        getParticipantPtr()->createDomain(getDomainIndex(), m_domainDataPtr, m_domainEnabled);
        domainCreated = true;
    }
    catch (std::exception& ex)
    {
        writeDomainWorkItemErrorMessage(ex, "Participant::createDomain");
    }

    *m_domainCreated = domainCreated;

    if (domainCreated == true)
    {
        //
        // Iterate through the list of policies and let them know about the new domain
        //

        auto policyManager = getPolicyManager();
        UIntN policyListCount = policyManager->getPolicyListCount();

        for (UIntN i = 0; i < policyListCount; i++)
        {
            try
            {
                Policy* policy = policyManager->getPolicyPtr(i);
                policy->bindDomain(getParticipantIndex(), getDomainIndex());
            }
            catch (policy_index_invalid ex)
            {
                // do nothing.  No item in the policy list at this index.
            }
            catch (std::exception& ex)
            {
                writeDomainWorkItemErrorMessagePolicy(ex, "Policy::bindDomain", i);
            }
        }
    }
}
Beispiel #7
0
void WIDomainDestroy::execute(void)
{
	writeDomainWorkItemStartingInfoMessage();

	if (getParticipantPtr()->isDomainValid(getDomainIndex()) == false)
	{
		writeDomainWorkItemErrorMessage("Received request to remove a domain that is invalid.");
	}
	else
	{
		auto policyManager = getPolicyManager();
		auto policyIndexes = policyManager->getPolicyIndexes();

		// Let each policy know that the domain is going away

		for (auto i = policyIndexes.begin(); i != policyIndexes.end(); ++i)
		{
			try
			{
				Policy* policy = policyManager->getPolicyPtr(*i);
				policy->unbindDomain(getParticipantIndex(), getDomainIndex());
			}
			catch (policy_index_invalid& ex)
			{
				// do nothing.  No item in the policy list at this index.
			}
			catch (std::exception& ex)
			{
				writeDomainWorkItemErrorMessagePolicy(ex, "Policy::unbindDomain", *i);
			}
		}

		// Let the participant know to remove the domain

		try
		{
			getParticipantPtr()->destroyDomain(getDomainIndex());
		}
		catch (std::exception& ex)
		{
			writeDomainWorkItemErrorMessage(ex, "Participant::destroyDomain");
		}
	}
}
Beispiel #8
0
void WIParticipantSpecificInfoChanged::execute(void)
{
    writeParticipantWorkItemStartingInfoMessage();

    try
    {
        getParticipantPtr()->participantSpecificInfoChanged();
    }
    catch (std::exception& ex)
    {
        writeParticipantWorkItemErrorMessage(ex, "Participant::participantSpecificInfoChanged");
    }

    auto policyManager = getPolicyManager();
    UIntN policyListCount = policyManager->getPolicyListCount();

    for (UIntN i = 0; i < policyListCount; i++)
    {
        try
        {
            Policy* policy = policyManager->getPolicyPtr(i);
            policy->executeParticipantSpecificInfoChanged(getParticipantIndex());
        }
        catch (policy_index_invalid ex)
        {
            // do nothing.  No item in the policy list at this index.
        }
        catch (temperature_out_of_range ex)
        {
            writeParticipantWorkItemWarningMessagePolicy(ex, "Policy::executeParticipantSpecificInfoChanged", i);
        }
        catch (std::exception& ex)
        {
            writeParticipantWorkItemWarningMessagePolicy(ex, "Policy::executeParticipantSpecificInfoChanged", i);
        }
    }
}
void WIPolicyOemVariablesChanged::execute(void)
{
	writeWorkItemStartingInfoMessage();

	auto policyManager = getPolicyManager();
	auto policyIndexes = policyManager->getPolicyIndexes();

	for (auto i = policyIndexes.begin(); i != policyIndexes.end(); ++i)
	{
		try
		{
			Policy* policy = policyManager->getPolicyPtr(*i);
			policy->executePolicyOemVariablesChanged();
		}
		catch (policy_index_invalid& ex)
		{
			// do nothing.  No item in the policy list at this index.
		}
		catch (std::exception& ex)
		{
			writeWorkItemErrorMessagePolicy(ex, "Policy::executePolicyOemVariablesChanged", *i);
		}
	}
}