Objectively
Ultra-lightweight object oriented framework for GNU C.
Loading...
Searching...
No Matches
URLSessionConfiguration.c
Go to the documentation of this file.
1/*
2 * URLSessionConfiguration.c
3 * Created on: Nov 30, 2014
4 * Author: jdolan
5 */
6
7
9
10#define _Class _URLSessionConfiguration
11
12#pragma mark - Object
13
17static void dealloc(Object *self) {
18
20
21 release(this->credentials.username);
22 release(this->credentials.password);
23 release(this->httpHeaders);
24 release(this->urlCache);
25
26 super(Object, self, dealloc);
27}
28
29#pragma mark - URLSessionConfiguration
30
36
37 self = (URLSessionConfiguration *) super(Object, self, init);
38 if (self) {
39 self->connectTimeout = 5;
40 self->urlCache = NULL;
41 }
42
43 return self;
44}
45
46#pragma mark - Class lifecycle
47
51static void initialize(Class *clazz) {
52
53 ((ObjectInterface *) clazz->interface)->dealloc = dealloc;
54
55 ((URLSessionConfigurationInterface *) clazz->interface)->init = init;
56}
57
63 static Class *clazz;
64 static Once once;
65
66 do_once(&once, {
67 clazz = _initialize(&(const ClassDef) {
68 .name = "URLSessionConfiguration",
69 .superclass = _Object(),
70 .instanceSize = sizeof(URLSessionConfiguration),
71 .interfaceOffset = offsetof(URLSessionConfiguration, interface),
72 .interfaceSize = sizeof(URLSessionConfigurationInterface),
74 });
75 });
76
77 return clazz;
78}
79
80#undef _Class
ident release(ident obj)
Atomically decrement the given Object's reference count. If the resulting reference count is 0,...
Definition Class.c:195
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition Class.c:86
#define super(type, obj, method,...)
Class * _Object(void)
Definition Object.c:136
static void dealloc(Object *self)
static URLSessionConfiguration * init(URLSessionConfiguration *self)
static void initialize(Class *clazz)
Class * _URLSessionConfiguration(void)
Configuration bundle for URLSession.
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
ident interface
The interface of the Class.
Definition Class.h:105
Object is the root Class of The Objectively Class hierarchy.
Definition Object.h:46
void dealloc(Object *self)
Frees all resources held by this Object.
Definition Array.c:99
Configuration bundle for URLSession.
long connectTimeout
The timeout interval for establishing a connection, in seconds. 0 means no limit.
URLCache * urlCache
The cache for URL responses, or NULL to disable caching.