Resource Tuner
Loading...
Searching...
No Matches
RequestManager Class Reference

RequestManager. More...

#include <RequestManager.h>

Public Member Functions

int8_t verifyHandle (int64_t handle)
 Check if a Request with the specified handle exists in the RequestMap.
 
int8_t shouldRequestBeAdded (Request *request)
 Checks whether the specified Request should be added to the RequestMap.
 
void addRequest (Request *request)
 Add the specified request to the RequestMap.
 
void removeRequest (Request *request)
 Remove a given request from the RequestMap.
 
RequestgetRequestFromMap (int64_t handle)
 Retrieve the Request with the given Handle.
 
int64_t getActiveReqeustsCount ()
 Get the current Global Active Requests Count.
 
void disableRequestProcessing (int64_t handle)
 Mark the Request Handle, so that the Request won't be applied.
 
void moveToPendingList ()
 Handles Device Mode transition from RESUME to SUSPEND.
 

Detailed Description

RequestManager.

Responsible for Tracking and Maintaining all the active Requests, currently submitted to the Resource Tuner Server. Additionally it is responsible for performing Request Duplication Check, which aims to improve System efficiency by reducing wasteful duplicate processing.

Definition at line 33 of file RequestManager.h.

Member Function Documentation

◆ addRequest()

void RequestManager::addRequest ( Request request)

Add the specified request to the RequestMap.

This routine should only be called if shouldRequestBeAdded returns 1.

Parameters
requestpointer to the request to be added to the map

◆ disableRequestProcessing()

void RequestManager::disableRequestProcessing ( int64_t  handle)

Mark the Request Handle, so that the Request won't be applied.

This method is used to Handle Untune Requests, as soon as an Untune Request for Handle h1 is received, we call this Rountine for h1, so that it doesn't get serviced in case it has not been inserted into the Coco Table yet. Note: If the Request was already inserted, then it will be untuned as and when the Untune Request gets serviced by the RequestQueue.

Parameters
handleRequest Identifier, for which processing needs to be disabled.

◆ getActiveReqeustsCount()

int64_t RequestManager::getActiveReqeustsCount ( )

Get the current Global Active Requests Count.

Returns
: int64_t

◆ getRequestFromMap()

Request * RequestManager::getRequestFromMap ( int64_t  handle)

Retrieve the Request with the given Handle.

Parameters
handleRequest Handle
Returns
Request*:
  • Pointer to the request with the specified index.

◆ moveToPendingList()

void RequestManager::moveToPendingList ( )

Handles Device Mode transition from RESUME to SUSPEND.

As part of this routine, the CocoTable will be drained out, i.e. all active Requests will be untuned, and the Resources restored to their original values. Requests which are not eligible for background processing will be removed from the Active List and put into the Pending List, so that they get processed again when the Device transitions back to the RESUME mode.

◆ removeRequest()

void RequestManager::removeRequest ( Request request)

Remove a given request from the RequestMap.

Parameters
requestpointer to the request to be removed from the map

◆ shouldRequestBeAdded()

int8_t RequestManager::shouldRequestBeAdded ( Request request)

Checks whether the specified Request should be added to the RequestMap.

This routine will perform Request Sanity and Duplicate checking.

Parameters
requestpointer to the request to be added to the map
Returns
int8_t:
  • 1: if the request should be added
  • 0: otherwise

◆ verifyHandle()

int8_t RequestManager::verifyHandle ( int64_t  handle)

Check if a Request with the specified handle exists in the RequestMap.

This routine is used by the retune/untune APIs

Parameters
handleRequest Handle
Returns
int8_t:
  • 1: if a request with the specified handle exists
  • 0: otherwise

The documentation for this class was generated from the following file: