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

Go to the source code of this file.

Data Structures

struct  GblOpaqueVTable
 
struct  GblOpaqueClass
 

Macros

Type System

Type UUID and cast macros

#define GBL_OPAQUE_TYPE
 
#define GBL_OPAQUE_CLASS(klass)
 

Typedefs

typedef GBL_RESULT(* GblOpaqueCopyFn) (void *pOpaque, void **ppNewOpaque)
 
typedef GBL_RESULT(* GblOpaqueFreeFn) (void *pOpaque)
 

Functions

Static Methods

Miscellaenous and Utility methods

GblType GblOpaque_type (void)
 
GblType GblOpaque_register (const char *pName, const GblOpaqueVTable *pVTable)
 
GblType GblOpaque_registerRef (const char *pName)
 
Instance Methods

Methods for dealing with opaque instances (usually handled internally)

GBL_RESULT GblOpaque_copy (void *pOpaque, GblType type, void **ppNewOpaque)
 
GBL_RESULT GblOpaque_free (void *pOpaque, GblType type)
 

Detailed Description

GblOpaqueClass and API for managing Opaque types.

Author
2023 Falco Girgis

Definition in file gimbal_opaque.h.

Macro Definition Documentation

◆ GBL_OPAQUE_TYPE

#define GBL_OPAQUE_TYPE

Type UUID for GblOpaque.

Definition at line 17 of file gimbal_opaque.h.

◆ GBL_OPAQUE_CLASS

#define GBL_OPAQUE_CLASS (   klass)

Function-style GblOpaqueClass cast from GblClass.

Definition at line 18 of file gimbal_opaque.h.

Typedef Documentation

◆ GblOpaqueCopyFn

typedef GBL_RESULT(* GblOpaqueCopyFn) (void *pOpaque, void **ppNewOpaque)

Function signature for for an opaque copy operation, see GblOpaqueVTable::pFnCopy.

Definition at line 24 of file gimbal_opaque.h.

◆ GblOpaqueFreeFn

typedef GBL_RESULT(* GblOpaqueFreeFn) (void *pOpaque)

Function signature for an opaque free operation, see GblOpaqueVTable::pFnFree.

Definition at line 26 of file gimbal_opaque.h.

Function Documentation

◆ GblOpaque_type()

GblType GblOpaque_type ( void  )

Returns the GblType UUID for GblOpaque.

◆ GblOpaque_register()

GblType GblOpaque_register ( const char *  pName,
const GblOpaqueVTable pVTable 
)

Registers an opaque subtype with the virtual table given by pVTable.

◆ GblOpaque_copy()

GBL_RESULT GblOpaque_copy ( void *  pOpaque,
GblType  type,
void **  ppNewOpaque 
)

Copies an opaque structure with the given type into ppNewOpaque, using its vtable.

◆ GblOpaque_free()

GBL_RESULT GblOpaque_free ( void *  pOpaque,
GblType  type 
)

Frees an opaque structure with the given type using its vtable.