本文整理汇总了C++中ManagerMessage类的典型用法代码示例。如果您正苦于以下问题:C++ ManagerMessage类的具体用法?C++ ManagerMessage怎么用?C++ ManagerMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ManagerMessage类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throwIfParticipantDomainCombinationInvalid
Temperature EsifServices::primitiveExecuteGetAsTemperatureC(esif_primitive_type primitive,
UIntN participantIndex, UIntN domainIndex, UInt8 instance)
{
throwIfParticipantDomainCombinationInvalid(FLF, participantIndex, domainIndex);
EsifDataTemperature esifResult;
eEsifError rc = m_esifInterface.fPrimitiveFuncPtr(m_esifHandle, m_dptfManager,
(void*)m_dptfManager->getIndexContainer()->getIndexPtr(participantIndex),
(void*)m_dptfManager->getIndexContainer()->getIndexPtr(domainIndex),
EsifDataVoid(), esifResult, primitive, instance);
#ifdef ONLY_LOG_TEMPERATURE_THRESHOLDS
// Added to help debug issue with missing temperature threshold events
if (primitive == esif_primitive_type::GET_TEMPERATURE)
{
ManagerMessage message = ManagerMessage(m_dptfManager, FLF,
"Requested participant temperature from ESIF.");
message.addMessage("Temperature", esifResult);
message.setEsifPrimitive(primitive, instance);
message.setParticipantAndDomainIndex(participantIndex, domainIndex);
message.setEsifErrorCode(rc);
writeMessageDebug(message, MessageCategory::TemperatureThresholds);
}
#endif
throwIfNotSuccessful(FLF, rc, primitive, participantIndex, domainIndex, instance);
return esifResult;
}
示例2: ManagerMessage
void EsifServices::throwIfNotSuccessful(const std::string& fileName, UIntN lineNumber,
const std::string& executingFunctionName, eEsifError returnCode, esif_primitive_type primitive,
UIntN participantIndex, UIntN domainIndex, UInt8 instance)
{
if (returnCode == ESIF_OK)
{
return;
}
ManagerMessage message = ManagerMessage(m_dptfManager, fileName, lineNumber, executingFunctionName,
"Error returned from ESIF services interface function call");
message.setEsifPrimitive(primitive, instance);
message.setParticipantAndDomainIndex(participantIndex, domainIndex);
message.setEsifErrorCode(returnCode);
if ((primitive == GET_TRIP_POINT_ACTIVE) && (returnCode == ESIF_I_ACPI_TRIP_POINT_NOT_PRESENT))
{
// no message. we still throw an exception to inform the policy.
}
else
{
writeMessageWarning(message);
}
throw primitive_execution_failed(message);
}
示例3: throwIfNotWorkItemThread
void PolicyServicesMessageLogging::writeMessageDebug(const DptfMessage& message)
{
throwIfNotWorkItemThread();
ManagerMessage updatedMessage = ManagerMessage(getDptfManager(), message);
updatedMessage.setPolicyIndex(getPolicyIndex());
getEsifServices()->writeMessageDebug(updatedMessage);
}
示例4: throwIfNotWorkItemThread
void ParticipantServices::writeMessageDebug(const DptfMessage& message)
{
throwIfNotWorkItemThread();
ManagerMessage updatedMessage = ManagerMessage(m_dptfManager, message);
updatedMessage.setParticipantIndex(m_participantIndex);
m_esifServices->writeMessageDebug(updatedMessage);
}
示例5: EsifDataString
void EsifServices::writeConfigurationUInt32(const std::string& elementPath, UInt32 elementValue)
{
eEsifError rc = m_esifInterface.fSetConfigFuncPtr(m_esifHandle, m_dptfManager, EsifDataString("dptf"),
EsifDataString(elementPath), EsifDataUInt32(elementValue), ESIF_SERVICE_CONFIG_PERSIST);
if (rc != ESIF_OK)
{
ManagerMessage message = ManagerMessage(m_dptfManager, FLF,
"Error returned from ESIF services interface function call");
message.addMessage("Element Path", elementPath);
message.addMessage("Element Value", elementValue);
message.setEsifErrorCode(rc);
writeMessageWarning(message);
throw dptf_exception(message);
}
}
示例6: ManagerMessage
void TemperatureThresholdArbitrator::throwIfTemperatureThresholdsInvalid(UIntN policyIndex,
const TemperatureThresholds& temperatureThresholds, const Temperature& currentTemperature)
{
Temperature aux0 = temperatureThresholds.getAux0();
Temperature aux1 = temperatureThresholds.getAux1();
if ((aux0.isValid() == true && aux0 > currentTemperature) ||
(aux1.isValid() == true && aux1 < currentTemperature))
{
ManagerMessage message = ManagerMessage(m_dptfManager, FLF,
"Received invalid temperature thresholds from policy.");
message.setPolicyIndex(policyIndex);
message.addMessage("Current Temperature", currentTemperature);
message.addMessage("Requested Aux0/Aux1", aux0.toString() + "/" + aux1.toString());
m_dptfManager->getEsifServices()->writeMessageError(message, MessageCategory::TemperatureThresholds);
throw dptf_exception(message);
}
}
示例7: catch
void ParticipantManager::destroyParticipant(UIntN participantIndex)
{
if ((participantIndex < m_participant.size()) && (m_participant[participantIndex] != nullptr))
{
try
{
m_participant[participantIndex]->destroyParticipant();
}
catch (...)
{
ManagerMessage message = ManagerMessage(m_dptfManager, FLF, "Failed while trying to destroy participant.");
message.addMessage("Participant Index", participantIndex);
m_dptfManager->getEsifServices()->writeMessageError(message);
}
DELETE_MEMORY_TC(m_participant[participantIndex]);
}
}
示例8: throwIfNotWorkItemThread
void PolicyServicesDomainTemperature::setTemperatureThresholds(UIntN participantIndex,
UIntN domainIndex, const TemperatureThresholds& temperatureThresholds)
{
throwIfNotWorkItemThread();
#ifdef ONLY_LOG_TEMPERATURE_THRESHOLDS
// Added to help debug issue with missing temperature threshold events
ManagerMessage message = ManagerMessage(getDptfManager(), FLF,
"Policy is calling PolicyServicesDomainTemperature::setTemperatureThresholds().");
message.addMessage("Aux0", temperatureThresholds.getAux0());
message.addMessage("Aux1", temperatureThresholds.getAux1());
message.setParticipantAndDomainIndex(participantIndex, domainIndex);
message.setPolicyIndex(getPolicyIndex());
getDptfManager()->getEsifServices()->writeMessageDebug(message, MessageCategory::TemperatureThresholds);
#endif
getParticipantManager()->getParticipantPtr(participantIndex)->setTemperatureThresholds(
domainIndex, getPolicyIndex(), temperatureThresholds);
}
示例9: esifResult
std::string EsifServices::readConfigurationString(const std::string& elementPath)
{
EsifDataString esifResult(Constants::DefaultBufferSize);
eEsifError rc = m_esifInterface.fGetConfigFuncPtr(m_esifHandle, m_dptfManager, EsifDataString("dptf"),
EsifDataString(elementPath), esifResult);
if (rc != ESIF_OK)
{
ManagerMessage message = ManagerMessage(m_dptfManager, FLF,
"Error returned from ESIF services interface function call");
message.addMessage("Element Path", elementPath);
message.setEsifErrorCode(rc);
writeMessageWarning(message);
throw dptf_exception(message);
}
return esifResult;
}
示例10: WIParticipantDestroy
void ParticipantManager::destroyAllParticipants(void)
{
auto participantIndexes = MapOps<UIntN, std::shared_ptr<Participant>>::getKeys(m_participants);
for (auto index = participantIndexes.begin(); index != participantIndexes.end(); ++index)
{
try
{
// Queue up a work item and wait for the return.
m_dptfManager->getDptfStatus()->clearCache();
WorkItem* workItem = new WIParticipantDestroy(m_dptfManager, *index);
m_dptfManager->getWorkItemQueueManager()->enqueueImmediateWorkItemAndWait(workItem);
}
catch (...)
{
ManagerMessage message = ManagerMessage(m_dptfManager, FLF, "Failed while trying to enqueue and wait for WIParticipantDestroy.");
message.addMessage("Participant Index", *index);
m_dptfManager->getEsifServices()->writeMessageError(message);
}
}
}
示例11: WIParticipantDestroy
void ParticipantManager::destroyAllParticipants(void)
{
for (UIntN i = 0; i < m_participant.size(); i++)
{
if (m_participant[i] != nullptr)
{
try
{
// Queue up a work item and wait for the return.
WorkItem* workItem = new WIParticipantDestroy(m_dptfManager, i);
m_dptfManager->getWorkItemQueueManager()->enqueueImmediateWorkItemAndWait(workItem);
}
catch (...)
{
ManagerMessage message = ManagerMessage(m_dptfManager, FLF, "Failed while trying to enqueue and wait for WIParticipantDestroy.");
message.addMessage("Participant Index", i);
m_dptfManager->getEsifServices()->writeMessageError(message);
}
}
}
}
示例12: esifMutexHelper
UIntN WorkItemQueueManager::removeIfMatches(const WorkItemMatchCriteria& matchCriteria)
{
EsifMutexHelper esifMutexHelper(&m_mutex);
esifMutexHelper.lock();
UIntN numRemovedImmediate = m_immediateQueue->removeIfMatches(matchCriteria);
UIntN numRemovedDeferred = m_deferredQueue->removeIfMatches(matchCriteria);
esifMutexHelper.unlock();
UIntN numRemoved = numRemovedImmediate + numRemovedDeferred;
if (numRemoved > 0)
{
ManagerMessage message = ManagerMessage(m_dptfManager, FLF, "One or more work items have been removed from the queues.");
message.addMessage("Immediate Queue removed", numRemovedImmediate);
message.addMessage("Deferred Queue removed", numRemovedDeferred);
m_dptfManager->getEsifServices()->writeMessageDebug(message);
}
return numRemoved;
}
示例13: catch
void ParticipantManager::destroyParticipant(UIntN participantIndex)
{
auto requestedParticipant = m_participants.find(participantIndex);
if (requestedParticipant != m_participants.end())
{
if (requestedParticipant->second != nullptr)
{
try
{
m_dptfManager->getDptfStatus()->clearCache();
requestedParticipant->second->destroyParticipant();
}
catch (...)
{
ManagerMessage message = ManagerMessage(m_dptfManager, FLF, "Failed while trying to destroy participant.");
message.addMessage("Participant Index", participantIndex);
m_dptfManager->getEsifServices()->writeMessageError(message);
}
}
m_participants.erase(requestedParticipant);
}
}
示例14: addArbitrationDataToMessage
void TemperatureThresholdArbitrator::addArbitrationDataToMessage(ManagerMessage& message, const std::string& title)
{
message.addMessage(" ");
message.addMessage(title);
message.addMessage("Last known participant temperature", m_lastKnownParticipantTemperature);
message.addMessage("Arbitrated Aux0/Aux1", m_arbitratedTemperatureThresholds.getAux0().toString() +
"/" + m_arbitratedTemperatureThresholds.getAux1().toString());
message.addMessage("--Requested temperature thresholds table contents--");
for (auto thresholds = m_requestedTemperatureThresholds.begin(); thresholds != m_requestedTemperatureThresholds.end(); thresholds++)
{
message.addMessage("Policy " + StlOverride::to_string(thresholds->first), thresholds->second.getAux0().toString() +
"/" + thresholds->second.getAux1().toString());
}
}