CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::URLSession Class Reference

An object that coordinates a group of related, network data transfer tasks. More...

#include <CeresEngine/Foundation/IO/URLSession.hpp>

Public Member Functions

 URLSession (ExecutionContext &executionContext)
 Creates a new URLSession instance.
 
 ~URLSession () noexcept
 Destroys an existing URLSession.
 
Async< URLResponseexecute (URLRequest request)
 
template<typename T , typename... Args>
TregisterProtocol (Args &&... args)
 
template<typename T >
void unregisterProtocol ()
 
ExecutionContextgetExecutionContext ()
 The execution context to which URL session callbacks will be called from.
 

Private Member Functions

void registerProtocol (URLProtocolPtr &&protocol)
 

Private Attributes

ExecutionContextmExecutionContext
 The execution context to which URL session callbacks will be called from.
 
LockedObject< Vector< URLProtocolPtr > > mProtocols
 A vector that contains all registered protocols.
 
LockedObject< List< UPtr< URLProtocol::Task > > > mConnections
 A list that contains a reference to all active connections.
 

Detailed Description

An object that coordinates a group of related, network data transfer tasks.

Constructor & Destructor Documentation

◆ URLSession()

CeresEngine::URLSession::URLSession ( ExecutionContext executionContext)
explicit

Creates a new URLSession instance.

◆ ~URLSession()

CeresEngine::URLSession::~URLSession ( )
noexcept

Destroys an existing URLSession.

Member Function Documentation

◆ execute()

Async< URLResponse > CeresEngine::URLSession::execute ( URLRequest  request)

◆ getExecutionContext()

ExecutionContext & CeresEngine::URLSession::getExecutionContext ( )
inline

The execution context to which URL session callbacks will be called from.

◆ registerProtocol() [1/2]

template<typename T , typename... Args>
T & CeresEngine::URLSession::registerProtocol ( Args &&...  args)
inline

◆ registerProtocol() [2/2]

void CeresEngine::URLSession::registerProtocol ( URLProtocolPtr &&  protocol)
private

◆ unregisterProtocol()

template<typename T >
void CeresEngine::URLSession::unregisterProtocol ( )
inline

Member Data Documentation

◆ mConnections

LockedObject<List<UPtr<URLProtocol::Task> > > CeresEngine::URLSession::mConnections
private

A list that contains a reference to all active connections.

◆ mExecutionContext

ExecutionContext& CeresEngine::URLSession::mExecutionContext
private

The execution context to which URL session callbacks will be called from.

◆ mProtocols

LockedObject<Vector<URLProtocolPtr> > CeresEngine::URLSession::mProtocols
private

A vector that contains all registered protocols.


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