WSF
WsfXIO_RequestManager Class Reference

Maintains a group of WsfXIO_Requests. More...

#include <WsfXIO_Request.hpp>

Inheritance diagram for WsfXIO_RequestManager:
Collaboration diagram for WsfXIO_RequestManager:

Public Types

using RequestMap = std::map<int, WsfXIO_Request*>
using SessionMap = std::map<WsfXIO_SubscriptionId, WsfXIO_ServiceSession*>

Public Member Functions

 WsfXIO_RequestManager (WsfXIO_Interface *aInterfacePtr)
virtual ~WsfXIO_RequestManager ()
void AddRequest (WsfXIO_Request *aRequestPtr)
void RemoveRequest (WsfXIO_Request *aRequestPtr)
bool RemoveRequest (int aRequestId)
WsfXIO_RequestFindRequest (int aRequestId)
 Returns the request with the given request ID if it exists.
void AddSession (WsfXIO_ServiceSession *aSessionPtr)
 Adds a session to the request manager for the primary goal of routing WsfXIO_ResponsePkt to the session.
void RemoveSession (WsfXIO_ServiceSession *aSessionPtr)
 Removes the session from the request manager.
const SessionMapGetSessions () const
const RequestMapGetRequests () const

Protected Member Functions

virtual void RequestCancelled (WsfXIO_Request *aRequestPtr)
void HandleRequestResponse (WsfXIO_ResponsePkt &aPkt)
void HandleCancel (WsfXIO_SubscriptionCancelPkt &aPkt)
 Handles subscription cancellation notifications.
void HandleDisconnect (WsfXIO_Connection *aConnectionPtr)
 Removes any requests on a lost connection.

Protected Attributes

UtCallbackHolder mCallbacks
WsfXIO_InterfacemInterfacePtr {nullptr}

Detailed Description

Maintains a group of WsfXIO_Requests.

Member Typedef Documentation

◆ RequestMap

◆ SessionMap

Constructor & Destructor Documentation

◆ WsfXIO_RequestManager()

◆ ~WsfXIO_RequestManager()

WsfXIO_RequestManager::~WsfXIO_RequestManager ( )
virtual

Member Function Documentation

◆ AddRequest()

void WsfXIO_RequestManager::AddRequest ( WsfXIO_Request * aRequestPtr)

Begins maintaining a WsfXIO_Request. The WsfXIO_RequestManager gains ownership of the request.

WsfXIO_RequestManager takes control of the request. The request is initialized and sent to the remote application. WsfXIO_RequestManager will delete the request upon cancellation.

References WsfXIO_Request::Initialized(), WsfXIO_Request::SetRequestId(), and WsfXIO_Request::SetRequestManager().

Referenced by WsfXIO_DisRequestManager::AddRequest(), and WsfXIO_TrackRequestManager::AddRequest().

◆ AddSession()

void WsfXIO_RequestManager::AddSession ( WsfXIO_ServiceSession * aSessionPtr)

Adds a session to the request manager for the primary goal of routing WsfXIO_ResponsePkt to the session.

References WsfXIO_Subscription::GetId(), and WsfXIO_ServiceSession::GetSubscription().

◆ FindRequest()

WsfXIO_Request * WsfXIO_RequestManager::FindRequest ( int aRequestId)

Returns the request with the given request ID if it exists.

◆ GetRequests()

const RequestMap & WsfXIO_RequestManager::GetRequests ( ) const
inline

◆ GetSessions()

const SessionMap & WsfXIO_RequestManager::GetSessions ( ) const
inline

◆ HandleCancel()

void WsfXIO_RequestManager::HandleCancel ( WsfXIO_SubscriptionCancelPkt & aPkt)
protected

◆ HandleDisconnect()

void WsfXIO_RequestManager::HandleDisconnect ( WsfXIO_Connection * aConnectionPtr)
protected

Removes any requests on a lost connection.

References RequestCancelled(), and WsfXIO_Request::SetRemotelyDestroyed().

Referenced by WsfXIO_RequestManager().

◆ HandleRequestResponse()

◆ RemoveRequest() [1/2]

bool WsfXIO_RequestManager::RemoveRequest ( int aRequestId)

Cancels a request currently owned by this request manager. The request will be deleted by this class. Returns 'true' if the request was found.

References RemoveRequest().

◆ RemoveRequest() [2/2]

void WsfXIO_RequestManager::RemoveRequest ( WsfXIO_Request * aRequestPtr)

Cancels a request currently owned by this request manager. The request will be deleted by this class.

References RequestCancelled().

Referenced by WsfXIO_DisRequestManager::RemoveRequest(), RemoveRequest(), WsfXIO_TrackRequestManager::RemoveRequest(), and WsfXIO_TrackRequestManager::RemoveRequest().

◆ RemoveSession()

void WsfXIO_RequestManager::RemoveSession ( WsfXIO_ServiceSession * aSessionPtr)

Removes the session from the request manager.

References WsfXIO_Subscription::GetId(), and WsfXIO_ServiceSession::GetSubscription().

◆ RequestCancelled()

Member Data Documentation

◆ mCallbacks

◆ mInterfacePtr

WsfXIO_Interface* WsfXIO_RequestManager::mInterfacePtr {nullptr}
protected

Referenced by WsfXIO_RequestManager().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved