SNode.C
Loading...
Searching...
No Matches
web::http::client::commands::UpgradeCommand Class Reference

#include <UpgradeCommand.h>

Inheritance diagram for web::http::client::commands::UpgradeCommand:
Collaboration diagram for web::http::client::commands::UpgradeCommand:

Public Member Functions

 UpgradeCommand (const std::string &url, const std::string &protocols, const std::function< void(const std::shared_ptr< Request > &, bool)> &onUpgradeInitiate)
 
 ~UpgradeCommand () override=default
 
bool execute (const std::shared_ptr< Request > &request) override
 
- Public Member Functions inherited from web::http::client::RequestCommand
 RequestCommand ()=default
 
 RequestCommand (const RequestCommand &)=delete
 
 RequestCommand (RequestCommand &&) noexcept=delete
 
RequestCommandoperator= (const RequestCommand &)=delete
 
RequestCommandoperator= (RequestCommand &&) noexcept=delete
 
virtual ~RequestCommand ()
 
bool getError () const
 

Private Attributes

std::string url
 
std::string protocols
 
const std::function< void(const std::shared_ptr< Request > &, bool)> onUpgradeInitiate
 

Additional Inherited Members

- Protected Attributes inherited from web::http::client::RequestCommand
const std::shared_ptr< Requestrequest
 
bool error = false
 

Detailed Description

Definition at line 57 of file UpgradeCommand.h.

Constructor & Destructor Documentation

◆ UpgradeCommand()

web::http::client::commands::UpgradeCommand::UpgradeCommand ( const std::string &  url,
const std::string &  protocols,
const std::function< void(const std::shared_ptr< Request > &, bool)> &  onUpgradeInitiate 
)

Definition at line 52 of file UpgradeCommand.cpp.

55 : url(url)
58 }
const std::function< void(const std::shared_ptr< Request > &, bool)> onUpgradeInitiate

References onUpgradeInitiate, protocols, and url.

Referenced by web::http::client::Request::upgrade().

Here is the caller graph for this function:

◆ ~UpgradeCommand()

web::http::client::commands::UpgradeCommand::~UpgradeCommand ( )
overridedefault

Member Function Documentation

◆ execute()

bool web::http::client::commands::UpgradeCommand::execute ( const std::shared_ptr< Request > &  request)
overridevirtual

Implements web::http::client::RequestCommand.

Definition at line 60 of file UpgradeCommand.cpp.

60 {
61 const bool ret = request->executeUpgrade(url, protocols, [this, request](bool success) {
62 onUpgradeInitiate(request, success);
63 });
64
65 return ret;
66 }
const std::shared_ptr< Request > request

References web::http::client::Request::executeUpgrade(), onUpgradeInitiate, protocols, and url.

Here is the call graph for this function:

Member Data Documentation

◆ onUpgradeInitiate

const std::function<void(const std::shared_ptr<Request>&, bool)> web::http::client::commands::UpgradeCommand::onUpgradeInitiate
private

Definition at line 72 of file UpgradeCommand.h.

Referenced by execute(), and UpgradeCommand().

◆ protocols

std::string web::http::client::commands::UpgradeCommand::protocols
private

Definition at line 71 of file UpgradeCommand.h.

Referenced by execute(), and UpgradeCommand().

◆ url

std::string web::http::client::commands::UpgradeCommand::url
private

Definition at line 70 of file UpgradeCommand.h.

Referenced by execute(), and UpgradeCommand().


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