redfish-core/lib/systems.hpp
inline void
    modifyCpuPresenceState(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
                           const std::variant<bool>& cpuPresenceState)
{
    const bool* isCpuPresent = std::get_if<bool>(&cpuPresenceState);

    if (isCpuPresent == nullptr)
    {
        messages::internalError(aResp->res);
        return;
    }
    BMCWEB_LOG_DEBUG << "Cpu Present: " << *isCpuPresent;

    if (*isCpuPresent == true)
    {
        nlohmann::json& procCount =
            aResp->res.jsonValue["ProcessorSummary"]["Count"];
        auto procCountPtr =
            procCount.get_ptr<nlohmann::json::number_integer_t*>();
        if (procCountPtr != nullptr)
        {
            // shouldn't be possible to be nullptr
            *procCountPtr += 1;
        }
    }
}
/*
 * @brief Update "ProcessorSummary" "Count" based on Cpu PresenceState
 *
 * @param[in] aResp Shared pointer for completing asynchronous calls
 * @param[in] cpuPresenceState CPU present or not
 *
 * @return None.
 */
@brief Update "ProcessorSummary" "Count" based on Cpu PresenceState
@param[in] aResp Shared pointer for completing asynchronous calls
@param[in] cpuPresenceState CPU present or not

@return None.
@brief Update " ProcessorSummary " " Count " based on Cpu PresenceState @param [ in ] aResp Shared pointer for completing asynchronous calls @param [ in ] cpuPresenceState CPU present or not @return None .
inline void
    modifyCpuPresenceState(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
                           const std::variant<bool>& cpuPresenceState)
{
    const bool* isCpuPresent = std::get_if<bool>(&cpuPresenceState);
    if (isCpuPresent == nullptr)
    {
        messages::internalError(aResp->res);
        return;
    }
    BMCWEB_LOG_DEBUG << "Cpu Present: " << *isCpuPresent;
    if (*isCpuPresent == true)
    {
        nlohmann::json& procCount =
            aResp->res.jsonValue["ProcessorSummary"]["Count"];
        auto procCountPtr =
            procCount.get_ptr<nlohmann::json::number_integer_t*>();
        if (procCountPtr != nullptr)
        {
            *procCountPtr += 1;
        }
    }
}
inline void modifyCpuPresenceState ( const std :: shared_ptr < bmcweb :: AsyncResp > & aResp , const std :: variant < bool > & cpuPresenceState ) { const bool * isCpuPresent = std :: get_if < bool > ( & cpuPresenceState ) ; if ( isCpuPresent == nullptr ) { messages :: internalError ( aResp -> res ) ; return ; } BMCWEB_LOG_DEBUG << " " << * isCpuPresent ; if ( * isCpuPresent == true ) { nlohmann :: json & procCount = aResp -> res . jsonValue [ " " ] [ " " ] ; auto procCountPtr = procCount . get_ptr < nlohmann :: json :: number_integer_t * > ( ) ; if ( procCountPtr != nullptr ) { * procCountPtr += 1 ; } } }
@brief Update "ProcessorSummary" "Count" based on Cpu PresenceState
 @param[in] aResp Shared pointer for completing asynchronous calls
 @param[in] cpuPresenceState CPU present or not
@brief Update " ProcessorSummary " " Count " based on Cpu PresenceState @param [ in ] aResp Shared pointer for completing asynchronous calls @param [ in ] cpuPresenceState CPU present or not
// shouldn't be possible to be nullptr