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

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)
 
Construction Macros

Helper macros for creating new GblObject instances.

#define GBL_NEW(...)
 
#define GBL_NEW_AT(...)
 

Functions

GblType GblObject_type (void)
 
GblContextGblObject_findContext (GblObject *pSelf)
 
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_createVa (GblType type, va_list *pList)
 
GblObjectGblObject_createExtVa (GblType type, size_t size, va_list *pList)
 
GBL_RESULT GblObject_constructVa (GblObject *pSelf, GblType type, va_list *pList)
 
GblObjectGblObject_createVaWithClass (GblObjectClass *pClass, va_list *pList)
 
GblObjectGblObject_createExtVaWithClass (GblObjectClass *pClass, size_t size, va_list *pList)
 
GBL_RESULT GblObject_constructVaWithClass (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.

Author
2023, 2024, 2025 Falco Girgis
2025 Agustín Bellagamba
Todo
  • Uninstall all signals upon class destructor (with property uninstallation)
  • Get rid of GblObject_findContext()
  • GblObject_set/addChildren() with propertyChange() signal
Test

Definition in file gimbal_object.h.

Macro Definition Documentation

◆ GBL_OBJECT_TYPE

#define GBL_OBJECT_TYPE

GblType UUID for GblObject.

Definition at line 40 of file gimbal_object.h.

◆ GBL_OBJECT

#define GBL_OBJECT ( self)

Casts a GblInstance to a GblObject.

Definition at line 41 of file gimbal_object.h.

◆ GBL_OBJECT_CLASS

#define GBL_OBJECT_CLASS ( klass)

Casts a GblClass to a GblObjectClass.

Definition at line 42 of file gimbal_object.h.

◆ GBL_OBJECT_GET_CLASS

#define GBL_OBJECT_GET_CLASS ( self)

Gets a GblObjectClass from a GblInstance.

Definition at line 43 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 54 of file gimbal_object.h.

◆ GBL_NEW_AT

#define GBL_NEW_AT ( ...)

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 59 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_createVa()

GblObject * GblObject_createVa ( GblType type,
va_list * pList )

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

◆ GblObject_createExtVa()

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

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

◆ GblObject_constructVa()

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

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

◆ GblObject_createVaWithClass()

GblObject * GblObject_createVaWithClass ( GblObjectClass * pClass,
va_list * pList )

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

◆ GblObject_createExtVaWithClass()

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

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

◆ GblObject_constructVaWithClass()

GBL_RESULT GblObject_constructVaWithClass ( 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.

◆ GblObject_findContext()

GblContext * GblObject_findContext ( GblObject * pSelf)