AWS IoT C++ SDK
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes
awsiotsdk::mqtt::UnsubscribeActionAsync Class Reference

Define a class for UnsubscribeActionAsync. More...

#include <Subscribe.hpp>

Inheritance diagram for awsiotsdk::mqtt::UnsubscribeActionAsync:
awsiotsdk::Action

Public Member Functions

 UnsubscribeActionAsync (const UnsubscribeActionAsync &)=delete
 
 UnsubscribeActionAsync (UnsubscribeActionAsync &&)=delete
 
UnsubscribeActionAsyncoperator= (const UnsubscribeActionAsync &) &=delete
 
UnsubscribeActionAsyncoperator= (UnsubscribeActionAsync &&) &=delete
 
 UnsubscribeActionAsync (std::shared_ptr< ClientState > p_client_state)
 Constructor. More...
 
ResponseCode PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)
 Perform MQTT Unsubscribe Action in Async mode. More...
 
- Public Member Functions inherited from awsiotsdk::Action
ActionType GetActionType ()
 Get Type of this Action. More...
 
util::String GetActionInfo ()
 Get information/description about the current action. More...
 
void SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue)
 Sets the parent thread sync variable. More...
 
virtual ResponseCode PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0
 Virtual base function for Performing Action. More...
 
 Action (const Action &)=delete
 
 Action (Action &&)=delete
 
Actionoperator= (const Action &) &=delete
 
Actionoperator= (Action &&) &=delete
 
 Action (ActionType action_type, util::String action_info_string)
 Action Constructor. More...
 

Static Public Member Functions

static std::unique_ptr< ActionCreate (std::shared_ptr< ActionState > p_action_state)
 Factory Create method. More...
 

Protected Attributes

std::shared_ptr< ClientStatep_client_state_
 Shared Client State instance.
 
- Protected Attributes inherited from awsiotsdk::Action
ActionType action_type_
 Type of the action.
 
util::String action_info_string_
 Info string.
 
std::shared_ptr< std::atomic_bool > p_thread_continue_
 Shared atomic variable used for sync when action is run in separate thread.
 

Additional Inherited Members

- Public Types inherited from awsiotsdk::Action
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> CreateHandlerPtr
 
- Protected Member Functions inherited from awsiotsdk::Action
ResponseCode ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read)
 Generic Network Read function for all actions. More...
 
ResponseCode WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf)
 Generic Network Write function for all actions. More...
 

Detailed Description

This class defines an Asynchronous action for performing a MQTT Unsubscribe operation

Constructor & Destructor Documentation

◆ UnsubscribeActionAsync()

awsiotsdk::mqtt::UnsubscribeActionAsync::UnsubscribeActionAsync ( std::shared_ptr< ClientState p_client_state)
Warning
This constructor can throw exceptions, it is recommended to use Factory create method Constructor is kept public to not restrict usage possibilities (eg. make_shared)
Parameters
p_client_state- Shared Client State instance

Member Function Documentation

◆ Create()

std::unique_ptr< Action > awsiotsdk::mqtt::UnsubscribeActionAsync::Create ( std::shared_ptr< ActionState p_action_state)
static
Parameters
p_client_state- Shared Client State instance
Returns
nullptr on error, unique_ptr pointing to a created UnsubscribeActionAsync instance if successful

◆ PerformAction()

ResponseCode awsiotsdk::mqtt::UnsubscribeActionAsync::PerformAction ( std::shared_ptr< NetworkConnection p_network_connection,
std::shared_ptr< ActionData p_action_data 
)
virtual

Performs the MQTT Unsubscribe Operation in Async mode. Does NOT deactivate or deregister active subscriptions. Does modify subscription information to keep track of which packet ID the unsuback request is using. Will NOT wait for UNSUBACK. Whenever UNSUBACK is received by the Network Read operation, the Subscriptions will be removed.

Parameters
p_network_connection- Network connection instance to use for performing this action
p_action_data- Action data specific to this execution of the Action
Returns
- ResponseCode indicating status of the operation

Implements awsiotsdk::Action.