Objectively
Ultra-lightweight object oriented framework for GNU C.
Loading...
Searching...
No Matches
URLSessionDataTask Struct Reference

#include <URLSessionDataTask.h>

Overview

Use data tasks to send and receive Data in-memory.

Data tasks are well suited for web service invocations.

Definition at line 44 of file URLSessionDataTask.h.

Inheritance diagram for URLSessionDataTask:
URLSessionTask Object

Properties

URLCachedResponsecachedResponse
 A cached response, if this task was fulfilled from URLCache.
 
void(* cacheResponse )(URLSessionDataTask *self)
 Stores this task's response in URLCache.
 
Datadata
 The data received.
 
URLSessionTask urlSessionTask
 The superclass.
 
- Properties inherited from URLSessionTask
size_t bytesExpectedToReceive
 The count of bytes this task expects to receive.
 
size_t bytesExpectedToSend
 The count of bytes this task expects to send.
 
size_t bytesReceived
 The count of bytes received.
 
size_t bytesSent
 The count of bytes sent.
 
URLSessionTaskCompletion completion
 The completion function.
 
ident data
 User data.
 
char * error
 The error buffer.
 
Object object
 The superclass.
 
URLSessionTaskProgress progress
 The progress function.
 
struct URLRequestrequest
 The request.
 
struct URLResponseresponse
 The response.
 
struct URLSessionsession
 The session.
 
URLSessionTaskState state
 The state.
 
- Properties inherited from Object
Classclazz
 Every instance of Object begins with a pointer to its Class.
 
unsigned int magic
 A header to allow introspection of Object types.
 

Methods

Class_URLSessionDataTask (void)
 The URLSessionDataTask archetype.
 
void cacheResponse (URLSessionDataTask *self)
 
- Methods inherited from URLSessionTask
Class_URLSessionTask (void)
 The URLSessionTask archetype.
 
void cancel (URLSessionTask *)
 Cancels this task.
 
void execute (URLSessionTask *)
 Executes this task synchronously, on the calling thread.
 
URLSessionTaskinitWithRequestInSession (URLSessionTask *, struct URLRequest *, struct URLSession *, URLSessionTaskCompletion)
 Initializes this task with the given URLRequest.
 
void resume (URLSessionTask *)
 Starts or resumes this task.
 
void setup (URLSessionTask *)
 Sets up this task.
 
void suspend (URLSessionTask *)
 Suspends this task.
 
void teardown (URLSessionTask *)
 Tears down this task.
 
- Methods inherited from Object
Class_Object (void)
 The Object archetype.
 
Objectcopy (const Object *self)
 Creates a shallow copy of this Object.
 
void dealloc (Object *self)
 Frees all resources held by this Object.
 
Stringdescription (const Object *self)
 
int hash (const Object *self)
 
Objectinit (Object *self)
 Initializes this Object.
 
bool isEqual (const Object *self, const Object *other)
 Tests equality of the other Object.
 
bool isKindOfClass (const Object *self, const Class *clazz)
 Tests for Class hierarchy membership.
 

Protected Attributes

URLSessionDataTaskInterface * interface
 The interface.
 
- Protected Attributes inherited from URLSessionTask
URLSessionTaskInterface * interface
 The interface.
 
- Protected Attributes inherited from Object
ObjectInterface * interface
 The interface.
 

Property Details

◆ cachedResponse

URLCachedResponse* URLSessionDataTask::cachedResponse

A cached response, if this task was fulfilled from URLCache.

Definition at line 65 of file URLSessionDataTask.h.

◆ cacheResponse

void(* cacheResponse) (URLSessionDataTask *self)

Stores this task's response in URLCache.

Definition at line 82 of file URLSessionDataTask.h.

◆ data

Data* URLSessionDataTask::data

The data received.

Definition at line 60 of file URLSessionDataTask.h.

◆ interface

URLSessionDataTaskInterface* URLSessionDataTask::interface
protected

The interface.

Definition at line 55 of file URLSessionDataTask.h.

◆ urlSessionTask

URLSessionTask URLSessionDataTask::urlSessionTask

The superclass.

Definition at line 49 of file URLSessionDataTask.h.

Method Details

◆ _URLSessionDataTask()

Class * _URLSessionDataTask ( void  )

The URLSessionDataTask archetype.

Returns
The URLSessionDataTask Class.

Definition at line 228 of file URLSessionDataTask.c.

228 {
229 static Class *clazz;
230 static Once once;
231
232 do_once(&once, {
233 clazz = _initialize(&(const ClassDef) {
234 .name = "URLSessionDataTask",
235 .superclass = _URLSessionTask(),
236 .instanceSize = sizeof(URLSessionDataTask),
237 .interfaceOffset = offsetof(URLSessionDataTask, interface),
238 .interfaceSize = sizeof(URLSessionDataTaskInterface),
240 });
241 });
242
243 return clazz;
244}
static void initialize(Class *clazz)
Definition Array.c:710
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition Class.c:86
long Once
The Once type.
Definition Once.h:37
#define do_once(once, block)
Executes the given block at most one time.
Definition Once.h:43
ClassDefs are passed to _initialize via an archetype to initialize a Class.
Definition Class.h:41
The runtime representation of a Class.
Definition Class.h:95
Class * clazz
Every instance of Object begins with a pointer to its Class.
Definition Object.h:55
Use data tasks to send and receive Data in-memory.
URLSessionDataTaskInterface * interface
The interface.
Class * _URLSessionTask(void)
The URLSessionTask archetype.

◆ cacheResponse()

void cacheResponse ( URLSessionDataTask self)

Definition at line 82 of file URLSessionDataTask.c.

82 {
83
84 if (self->cachedResponse) {
85 return;
86 }
87
89 if (cache) {
91 }
92}
static void storeCachedResponseForRequest(URLCache *self, const URLRequest *request, const URLResponse *response, const Data *data)
Definition URLCache.c:356
A cache for HTTP responses.
Definition URLCache.h:44
URLCache * urlCache
The cache for URL responses, or NULL to disable caching.
URLCachedResponse * cachedResponse
A cached response, if this task was fulfilled from URLCache.
Data * data
The data received.
URLSessionTask urlSessionTask
The superclass.
URLSessionConfiguration * configuration
The session configuration.
Definition URLSession.h:98
struct URLResponse * response
The response.
struct URLRequest * request
The request.
struct URLSession * session
The session.

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