libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_object.h File Reference

Go to the source code of this file.

Data Structures

struct  GblObjectClass
 
class  GblObject
 

Macros

#define GBL_NEW(...)
 
#define GBL_PLACEMENT_NEW(...)
 
Type System

Type UUID and Cast operators

#define GBL_OBJECT_TYPE
 
#define GBL_OBJECT(self)
 
#define GBL_OBJECT_CLASS(klass)
 
#define GBL_OBJECT_GET_CLASS(self)
 

Functions

GblType GblObject_type (void)
 
Constructors

Methods for constructing GblObject-derived types

GblObjectGblObject_create (GblType type,...)
 
GblObjectGblObject_createExt (GblType type, size_t size,...)
 
GBL_RESULT GblObject_construct (GblObject *pSelf, GblType type,...)
 
GblObjectGblObject_createWithClass (GblObjectClass *pClass,...)
 
GblObjectGblObject_createExtWithClass (GblObjectClass *pClass, size_t size,...)
 
GBL_RESULT GblObject_constructWithClass (GblObject *pSelf, GblObjectClass *pClass,...)
 
GblObjectGblObject_createVaList (GblType type, va_list *pList)
 
GblObjectGblObject_createExtVaList (GblType type, size_t size, va_list *pList)
 
GBL_RESULT GblObject_constructVaList (GblObject *pSelf, GblType type, va_list *pList)
 
GblObjectGblObject_createVaListWithClass (GblObjectClass *pClass, va_list *pList)
 
GblObjectGblObject_createExtVaListWithClass (GblObjectClass *pClass, size_t size, va_list *pList)
 
GBL_RESULT GblObject_constructVaListWithClass (GblObject *pSelf, GblObjectClass *pClass, va_list *pList)
 
GblObjectGblObject_createVariants (GblType type, size_t propertyCount, const char *pNames[], GblVariant *pValues)
 
GblObjectGblObject_createVariantsExt (GblType type, size_t size, size_t propertyCount, const char *pNames[], GblVariant *pValues)
 
GBL_RESULT GblObject_constructVariants (GblObject *pSelf, GblType type, size_t propertyCount, const char *pNames[], GblVariant *pValues)
 
GblObjectGblObject_createVariantsWithClass (GblObjectClass *pClass, size_t propertyCount, const char *pNames[], GblVariant *pValues)
 
GblObjectGblObject_createVariantsExtWithClass (GblObjectClass *pClass, size_t size, size_t propertyCount, const char *pNames[], GblVariant *pValues)
 
GBL_RESULT GblObject_constructVariantsWithClass (GblObject *pSelf, GblObjectClass *pClass, size_t propertyCount, const char *pNames[], GblVariant *pValues)
 

Detailed Description

GblObject structure and related functions.

This file contains the type definitions and API for GblObject and GblObjectClass. This is the instantiable type which provides the OO meat of the instantiable types– such as properties, hierarchial relationships, event management, generic construction, named instances, etc.

Todo:
  • Uninstall all signals upon class destructor (with property uninstallation)
  • Fix construction
    • initializer calls constructor? Wtf?
  • implement class property
  • Get rid of GblObject_findContext()
Author
2023, 2024 Falco Girgis

Definition in file gimbal_object.h.

Macro Definition Documentation

◆ GBL_OBJECT_TYPE

#define GBL_OBJECT_TYPE

GblType UUID for GblObject.

Definition at line 34 of file gimbal_object.h.

◆ GBL_OBJECT

#define GBL_OBJECT (   self)

Casts a GblInstance to a GblObject.

Definition at line 35 of file gimbal_object.h.

◆ GBL_OBJECT_CLASS

#define GBL_OBJECT_CLASS (   klass)

Casts a GblClass to a GblObjectClass.

Definition at line 36 of file gimbal_object.h.

◆ GBL_OBJECT_GET_CLASS

#define GBL_OBJECT_GET_CLASS (   self)

Gets a GblObjectClass from a GblInstance.

Definition at line 37 of file gimbal_object.h.

◆ GBL_NEW

#define GBL_NEW (   ...)

DSL macro used to heap-construct a GblObject-derived type.

It takes the struct name followed by an optional list of property KV pairs.

Definition at line 43 of file gimbal_object.h.

◆ GBL_PLACEMENT_NEW

#define GBL_PLACEMENT_NEW (   ...)

DSL macro used to placement-construct a GblObject-derived type It takes the struct name followed by an optional list of property KV pairs.

Definition at line 47 of file gimbal_object.h.

Function Documentation

◆ GblObject_type()

GblType GblObject_type ( void  )

Returns the GblType UUID associated with GblObject.

◆ GblObject_create()

GblObject * GblObject_create ( GblType  type,
  ... 
)

Creates an object-derived type on the heap, intializing it with a NULL-terminated K,V pair listing of properties.

◆ GblObject_createExt()

GblObject * GblObject_createExt ( GblType  type,
size_t  size,
  ... 
)

Variant of GblObject_create(), where the object is created with an extended size.

◆ GblObject_construct()

GBL_RESULT GblObject_construct ( GblObject pSelf,
GblType  type,
  ... 
)

Constructs an object-derived type in-place, initializing it with a NULL-terminated K,V pair listing of properties.

◆ GblObject_createWithClass()

GblObject * GblObject_createWithClass ( GblObjectClass pClass,
  ... 
)

Creates an object-derived type on the heap, with the given class, initializing it with a NULL-terminated K,V pair property list.

◆ GblObject_createExtWithClass()

GblObject * GblObject_createExtWithClass ( GblObjectClass pClass,
size_t  size,
  ... 
)

Variant of GblObject_createWithClass(), where the object is created with an extended size.

◆ GblObject_constructWithClass()

GBL_RESULT GblObject_constructWithClass ( GblObject pSelf,
GblObjectClass pClass,
  ... 
)

Constructs an object-derived type in-place, with the given class, initializing it with a NULL-terminated K,V pair property list.

◆ GblObject_createVaList()

GblObject * GblObject_createVaList ( GblType  type,
va_list *  pList 
)

Variant of GblObject_create(), where the property list is provided as a va_list pointer.

◆ GblObject_createExtVaList()

GblObject * GblObject_createExtVaList ( GblType  type,
size_t  size,
va_list *  pList 
)

Variant of GblObject_createVaList(), where the object is created with an extended size.

◆ GblObject_constructVaList()

GBL_RESULT GblObject_constructVaList ( GblObject pSelf,
GblType  type,
va_list *  pList 
)

Variant of GblObject_construct(), where the property list is provided as a va_list pointer.

◆ GblObject_createVaListWithClass()

GblObject * GblObject_createVaListWithClass ( GblObjectClass pClass,
va_list *  pList 
)

Variant of GblObject_createWithClass(), where the property list is provided as a va_list pointer.

◆ GblObject_createExtVaListWithClass()

GblObject * GblObject_createExtVaListWithClass ( GblObjectClass pClass,
size_t  size,
va_list *  pList 
)

Variant of GblObject_createVaListWithClass(), where the object is allocated with an extended size.

◆ GblObject_constructVaListWithClass()

GBL_RESULT GblObject_constructVaListWithClass ( GblObject pSelf,
GblObjectClass pClass,
va_list *  pList 
)

Variant of GblObjecT_constructWithClass(), where the property list is provided as a va_list pointer.

◆ GblObject_createVariants()

GblObject * GblObject_createVariants ( GblType  type,
size_t  propertyCount,
const char *  pNames[],
GblVariant pValues 
)

Creates an object-derived type on the heap, initializing it with an array of property values and a corresponding array of names.

◆ GblObject_createVariantsExt()

GblObject * GblObject_createVariantsExt ( GblType  type,
size_t  size,
size_t  propertyCount,
const char *  pNames[],
GblVariant pValues 
)

Variant of GblObject_createVariants(), where the object is allocated with an extended size.

◆ GblObject_constructVariants()

GBL_RESULT GblObject_constructVariants ( GblObject pSelf,
GblType  type,
size_t  propertyCount,
const char *  pNames[],
GblVariant pValues 
)

Creates an object-derived type in-place, initiailzing it with an array of property values and a corresponding array of names.

◆ GblObject_createVariantsWithClass()

GblObject * GblObject_createVariantsWithClass ( GblObjectClass pClass,
size_t  propertyCount,
const char *  pNames[],
GblVariant pValues 
)

Variant of GblObject_createVariants(), where the object is constructed with a weak reference to the given class.

◆ GblObject_createVariantsExtWithClass()

GblObject * GblObject_createVariantsExtWithClass ( GblObjectClass pClass,
size_t  size,
size_t  propertyCount,
const char *  pNames[],
GblVariant pValues 
)

Variant of GblObject_createVariantsWithClass(), where the object is allocated with an extended size.

◆ GblObject_constructVariantsWithClass()

GBL_RESULT GblObject_constructVariantsWithClass ( GblObject pSelf,
GblObjectClass pClass,
size_t  propertyCount,
const char *  pNames[],
GblVariant pValues 
)

Variant of GblObject_constructVariants(), where the object is constructed with a weak reference to the given class.