Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
Data Structures | Typedefs | Functions
Value.h File Reference

Values provide Object encapsulation for C types. More...

#include <Objectively/Object.h>

Go to the source code of this file.

Data Structures

struct  Value
 Values provide Object encapsulation for C types. More...
 

Typedefs

typedef void(* ValueDestructor) (ident value)
 Values may optionally reference a destructor to be called on dealloc. More...
 

Functions

OBJECTIVELY_EXPORT Class_Value (void)
 

Detailed Description

Values provide Object encapsulation for C types.

Definition in file Value.h.

Typedef Documentation

◆ ValueDestructor

typedef void(* ValueDestructor) (ident value)

Values may optionally reference a destructor to be called on dealloc.

Definition at line 39 of file Value.h.

Function Documentation

◆ _Value()

OBJECTIVELY_EXPORT Class * _Value ( void  )

Definition at line 136 of file Value.c.

136 {
137 static Class *clazz;
138 static Once once;
139
140 do_once(&once, {
141 clazz = _initialize(&(const ClassDef) {
142 .name = "Value",
143 .superclass = _Object(),
144 .instanceSize = sizeof(Value),
145 .interfaceOffset = offsetof(Value, interface),
146 .interfaceSize = sizeof(ValueInterface),
148 });
149 });
150
151 return clazz;
152}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition: Class.c:91
static void initialize(Class *clazz)
Definition: Value.c:122
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 * _Object(void)
The Object archetype.
Definition: Object.c:136
Values provide Object encapsulation for C types.
Definition: Value.h:45