Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
Properties
ClassDef Struct Reference

#include <Class.h>

Overview

ClassDefs are passed to _initialize via an archetype to initialize a Class.

Definition at line 41 of file Class.h.

Properties

void(* destroy )(Class *clazz)
 The Class destructor (optional). This method is run for initialized Classes when your application exits. More...
 
void(* initialize )(Class *clazz)
 The Class initializer (optional). More...
 
size_t instanceSize
 The instance size (required). More...
 
ptrdiff_t interfaceOffset
 The interface offset (required). More...
 
size_t interfaceSize
 The interface size (required). More...
 
const char * name
 The Class name (required). More...
 
Classsuperclass
 The superclass (required). e.g. _Object(). More...
 

Property Details

◆ destroy

void(* ClassDef::destroy) (Class *clazz)

The Class destructor (optional). This method is run for initialized Classes when your application exits.

Definition at line 47 of file Class.h.

◆ initialize

void(* ClassDef::initialize) (Class *clazz)

The Class initializer (optional).

Objectively invokes your Class initializer the first time your Class is required; either via _alloc, or via static method invocation. The Class initializer is responsible for populating the Class' interface with valid method implementations:

static void initialize(Class *clazz) {
((ObjectInterface *) clazz->interface)->dealloc = dealloc;
((FooInterface *) clazz->interface)->bar = bar;
}
static void dealloc(Object *self)
Definition: Array.c:50
void(* initialize)(Class *clazz)
The Class initializer (optional).
Definition: Class.h:64
The runtime representation of a Class.
Definition: Class.h:95
ident interface
The interface of the Class.
Definition: Class.h:105
Remarks
Each Class' interface is copied from its superclass before this initializer is called. Therefore, only overridden methods, and methods unique to the Class itself, must be set via initialize.

Definition at line 64 of file Class.h.

◆ instanceSize

size_t ClassDef::instanceSize

The instance size (required).

Definition at line 69 of file Class.h.

◆ interfaceOffset

ptrdiff_t ClassDef::interfaceOffset

The interface offset (required).

Definition at line 74 of file Class.h.

◆ interfaceSize

size_t ClassDef::interfaceSize

The interface size (required).

Definition at line 79 of file Class.h.

◆ name

const char* ClassDef::name

The Class name (required).

Definition at line 84 of file Class.h.

◆ superclass

Class* ClassDef::superclass

The superclass (required). e.g. _Object().

Definition at line 89 of file Class.h.


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