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

Go to the source code of this file.

Data Structures

struct  GblPropertyClass
 
struct  GblProperty
 

Macros

#define GBL_GENERIC_PROPERTY_TYPE
 
Type System

UUID and Cast Operators

#define GBL_PROPERTY_TYPE
 
#define GBL_PROPERTY(self)
 
#define GBL_PROPERTY_CLASS(klass)
 
#define GBL_PROPERTY_GET_CLASS(self)
 
Helper DSL

Helper macros for declaration and registration

#define GBL_PROPERTIES(object, ...)
 
#define GBL_PROPERTIES_REGISTER(...)
 

Typedefs

typedef GblBool(* GblPropertyIterFn) (const GblProperty *pProp, void *pClosure)
 
typedef GblEnum GBL_PROPERTY_FLAG
 

Enumerations

enum  GBL_PROPERTY_FLAG
 

Functions

GblType GblProperty_type (void)
 
size_t GblProperty_totalCount (void)
 
GBL_RESULT GblProperty_install (GblType objType, GblProperty *pProp)
 
GblBool GblProperty_uninstall (GblType objType, const char *pName)
 
GblBool GblProperty_uninstallQuark (GblType objType, GblQuark name)
 
GblBool GblProperty_uninstallAll (GblType objType)
 
size_t GblProperty_count (GblType objectType)
 
GblFlags GblProperty_combinedFlags (GblType objectType)
 
const GblPropertyGblProperty_find (GblType objectType, const char *pName)
 
const GblPropertyGblProperty_findQuark (GblType objectType, GblQuark name)
 
const GblPropertyGblProperty_next (GblType objectType, const GblProperty *pPrev, GblFlags mask)
 
GblBool GblProperty_foreach (GblType objectType, GBL_PROPERTY_FLAG flags, GblPropertyIterFn pFnIt, void *pClosure)
 
GblPropertyGblProperty_create (GblType derivedType, const char *pName, size_t id, GblFlags flags, size_t optionalArgCount,...)
 
GblPropertyGblProperty_createVaList (GblType derivedType, const char *pName, size_t id, GblFlags flags, size_t optionalArgCount, va_list *pList)
 
GBL_RESULT GblProperty_construct (GblProperty *pSelf, GblType derivedType, const char *pName, size_t id, GblFlags flags, size_t optionalArgCount,...)
 
GBL_RESULT GblProperty_constructVaList (GblProperty *pSelf, GblType derivedType, const char *pName, size_t id, GblFlags flags, size_t optionalArgCount, va_list *pList)
 
GBL_RESULT GblProperty_createOrConstruct (GblProperty **ppSelf, GblType derivedType, const char *pName, size_t id, GblFlags flags, size_t optionalArgCount,...)
 
GblType GblProperty_objectType (const GblProperty *pSelf)
 
const char * GblProperty_nameString (const GblProperty *pSelf)
 
GBL_RESULT GblProperty_defaultValue (const GblProperty *pSelf, GblVariant *pValue)
 
GblBool GblProperty_checkValue (const GblProperty *pSelf, const GblVariant *pValue)
 
GBL_RESULT GblProperty_validateValue (const GblProperty *pSelf, GblVariant *pValue)
 
int GblProperty_compareValues (const GblProperty *pSelf, const GblVariant *pV1, const GblVariant *pV2)
 

Detailed Description

GblProperty instance, DSL, and management API.

This file contains the type declarations and methods for GblProperty, the root property instance from which all other properties are derived.

Author
2023 Falco Girgis

Definition in file gimbal_property.h.

Macro Definition Documentation

◆ GBL_PROPERTY_TYPE

#define GBL_PROPERTY_TYPE

Type UUID for GblProperty.

Definition at line 21 of file gimbal_property.h.

◆ GBL_PROPERTY

#define GBL_PROPERTY (   self)

Casts a GblInstance to GblProperty.

Definition at line 22 of file gimbal_property.h.

◆ GBL_PROPERTY_CLASS

#define GBL_PROPERTY_CLASS (   klass)

Casts a GblClass to GblPropertyClass.

Definition at line 23 of file gimbal_property.h.

◆ GBL_PROPERTY_GET_CLASS

#define GBL_PROPERTY_GET_CLASS (   self)

Gets a GblPropertyClass from GblInstance.

Definition at line 24 of file gimbal_property.h.

◆ GBL_GENERIC_PROPERTY_TYPE

#define GBL_GENERIC_PROPERTY_TYPE

Alternate type identifier for GblProperty.

Definition at line 28 of file gimbal_property.h.

◆ GBL_PROPERTIES

#define GBL_PROPERTIES (   object,
  ... 
)

Declares a list of properties for the given object/instance structure.

Definition at line 35 of file gimbal_property.h.

◆ GBL_PROPERTIES_REGISTER

#define GBL_PROPERTIES_REGISTER (   ...)

Registeres the list of properties which were declared with GBL_PROPERTIES()

Definition at line 37 of file gimbal_property.h.

Typedef Documentation

◆ GblPropertyIterFn

typedef GblBool(* GblPropertyIterFn) (const GblProperty *pProp, void *pClosure)

Function signature used as an iterator with GblProperty_foreach()

Definition at line 47 of file gimbal_property.h.

◆ GBL_PROPERTY_FLAG

Definition at line 52 of file gimbal_property.h.

Enumeration Type Documentation

◆ GBL_PROPERTY_FLAG

Flags used to denote property attributes.

Enumerator
GBL_PROPERTY_FLAG_CONSTRUCT 

Property must be given to the constructor.

GBL_PROPERTY_FLAG_READ 

Property value can be read.

GBL_PROPERTY_FLAG_WRITE 

Property value can be modified.

GBL_PROPERTY_FLAG_SAVE 

Property is serialized when saving.

GBL_PROPERTY_FLAG_LOAD 

Property is deserialized when loading.

GBL_PROPERTY_FLAG_ABSTRACT 

Property must be implemented by deriving type.

GBL_PROPERTY_FLAG_OVERRIDE 

Property overrides an existing property.

GBL_PROPERTY_FLAG_READ_WRITE 

Property is both readable and writable.

GBL_PROPERTY_FLAG_SAVE_LOAD 

Property is both savable and loadable.

GBL_PROPERTY_FLAG_ALL 

Mask for all property flags.

Definition at line 52 of file gimbal_property.h.

52 {
53 GBL_PROPERTY_FLAG_CONSTRUCT = 0x1, //!< Property must be given to the constructor
54 GBL_PROPERTY_FLAG_READ = 0x2, //!< Property value can be read
55 GBL_PROPERTY_FLAG_WRITE = 0x4, //!< Property value can be modified
56 GBL_PROPERTY_FLAG_SAVE = 0x8, //!< Property is serialized when saving
57 GBL_PROPERTY_FLAG_LOAD = 0x10, //!< Property is deserialized when loading
58 GBL_PROPERTY_FLAG_ABSTRACT = 0x20, //!< Property must be implemented by deriving type
59 GBL_PROPERTY_FLAG_OVERRIDE = 0x40, //!< Property overrides an existing property
60 GBL_PROPERTY_FLAG_READ_WRITE = 0x6, //!< Property is both readable and writable
61 GBL_PROPERTY_FLAG_SAVE_LOAD = 0x18, //!< Property is both savable and loadable
62 GBL_PROPERTY_FLAG_ALL = 0xffff //!< Mask for all property flags
63};
@ GBL_PROPERTY_FLAG_READ
Property value can be read.
@ GBL_PROPERTY_FLAG_SAVE_LOAD
Property is both savable and loadable.
@ GBL_PROPERTY_FLAG_ABSTRACT
Property must be implemented by deriving type.
@ GBL_PROPERTY_FLAG_WRITE
Property value can be modified.
@ GBL_PROPERTY_FLAG_LOAD
Property is deserialized when loading.
@ GBL_PROPERTY_FLAG_SAVE
Property is serialized when saving.
@ GBL_PROPERTY_FLAG_CONSTRUCT
Property must be given to the constructor.
@ GBL_PROPERTY_FLAG_OVERRIDE
Property overrides an existing property.
@ GBL_PROPERTY_FLAG_READ_WRITE
Property is both readable and writable.
@ GBL_PROPERTY_FLAG_ALL
Mask for all property flags.