|
libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
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) |
Management | |
Routines for installing and uninstalling properties. | |
| 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) |
Info | |
Querying for miscellaneous property info. | |
| size_t | GblProperty_totalCount (void) |
| size_t | GblProperty_count (GblType objectType) |
| GblFlags | GblProperty_combinedFlags (GblType objectType) |
Querying | |
Routines for looking up installed properties. | |
| const GblProperty * | GblProperty_find (GblType objectType, const char *pName) |
| const GblProperty * | GblProperty_findQuark (GblType objectType, GblQuark name) |
Iterating | |
Routines for iterating over installed properties. | |
| const GblProperty * | GblProperty_next (GblType objectType, const GblProperty *pPrev, GblFlags mask) |
| GblBool | GblProperty_foreach (GblType objectType, GBL_PROPERTY_FLAG flags, GblPropertyIterFn pFnIt, void *pClosure) |
Initializing | |
Routines for creating and constructing new properties. | |
| GblProperty * | GblProperty_create (GblType derivedType, const char *pName, size_t id, GblFlags flags, size_t optionalArgCount,...) |
| GblProperty * | GblProperty_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,...) |
Accessors | |
Routines for accessing internal property data. | |
| GblType | GblProperty_objectType (const GblProperty *pSelf) |
| const char * | GblProperty_name (const GblProperty *pSelf) |
Methods | |
Routines for calling class methods on properties. | |
| 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) |
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.
Properties are string-keyed values of any data type which can be added to a GblObject.
Definition in file gimbal_property.h.
| #define GBL_PROPERTY_TYPE |
Type UUID for GblProperty.
Definition at line 24 of file gimbal_property.h.
| #define GBL_PROPERTY | ( | self | ) |
Casts a GblInstance to GblProperty.
Definition at line 25 of file gimbal_property.h.
| #define GBL_PROPERTY_CLASS | ( | klass | ) |
Casts a GblClass to GblPropertyClass.
Definition at line 26 of file gimbal_property.h.
| #define GBL_PROPERTY_GET_CLASS | ( | self | ) |
Gets a GblPropertyClass from GblInstance.
Definition at line 27 of file gimbal_property.h.
| #define GBL_GENERIC_PROPERTY_TYPE |
Alternate type identifier for GblProperty.
Definition at line 31 of file gimbal_property.h.
| #define GBL_PROPERTIES | ( | object, | |
| ... ) |
Declares a list of properties for the given object/instance structure.
Definition at line 38 of file gimbal_property.h.
| #define GBL_PROPERTIES_REGISTER | ( | ... | ) |
Registers the list of properties which were declared with GBL_PROPERTIES()
Definition at line 40 of file gimbal_property.h.
| typedef GblBool(* GblPropertyIterFn) (const GblProperty *pProp, void *pClosure) |
Function signature used as an iterator with GblProperty_foreach(), returns GBL_FALSE when iteration should cease.
Definition at line 50 of file gimbal_property.h.
| typedef GblEnum GBL_PROPERTY_FLAG |
Definition at line 55 of file gimbal_property.h.
| enum GBL_PROPERTY_FLAG |
Flags used to denote property attributes.
Definition at line 55 of file gimbal_property.h.
| GblType GblProperty_type | ( | void | ) |
Returns the UUID associated with the GblProperty type, registering it if it hasn't been already.
| GBL_RESULT GblProperty_install | ( | GblType | objType, |
| GblProperty * | pProp ) |
Installs the given property onto the given type (which must be GblObject compatible).
Uninstalls the property with the given name from the given object type.
Uninstalls the property with the given name quark from the given object type.
Uninstalls all properties which were previously installed onto the given object type.
| size_t GblProperty_totalCount | ( | void | ) |
Returns the total number of properties which have been registered onto any GblType.
| size_t GblProperty_count | ( | GblType | objectType | ) |
Returns the number of properties which were explicitly registered to the given type (not including inherited properties).
Returns the combined, bitwise OR'd flags from all properties registered onto the given type.
| const GblProperty * GblProperty_find | ( | GblType | objectType, |
| const char * | pName ) |
Looks up the given property by string name which was previously installed onto the given GblObject type.
| const GblProperty * GblProperty_findQuark | ( | GblType | objectType, |
| GblQuark | name ) |
| const GblProperty * GblProperty_next | ( | GblType | objectType, |
| const GblProperty * | pPrev, | ||
| GblFlags | mask ) |
Returns the next property installed onto the given type, given the current property (or NULL for the first) and the flag mask for which properties to include.
| GblBool GblProperty_foreach | ( | GblType | objectType, |
| GBL_PROPERTY_FLAG | flags, | ||
| GblPropertyIterFn | pFnIt, | ||
| void * | pClosure ) |
Iterates over the properties installed onto the given type containing any of the given flags, calling the given callback, which gets passed back an optional closure. Returns false if the callback returns false to end iteration.
| GblProperty * GblProperty_create | ( | GblType | derivedType, |
| const char * | pName, | ||
| size_t | id, | ||
| GblFlags | flags, | ||
| size_t | optionalArgCount, | ||
| ... ) |
Creates a new property on the heap with the given type, name, id, flags, and any optional arguments handled by its optional argument initializer.
| GblProperty * GblProperty_createVaList | ( | GblType | derivedType, |
| const char * | pName, | ||
| size_t | id, | ||
| GblFlags | flags, | ||
| size_t | optionalArgCount, | ||
| va_list * | pList ) |
Equivalent to GblProperty_create(), except taking a va_list rather than variadic argument list.
| GBL_RESULT GblProperty_construct | ( | GblProperty * | pSelf, |
| GblType | derivedType, | ||
| const char * | pName, | ||
| size_t | id, | ||
| GblFlags | flags, | ||
| size_t | optionalArgCount, | ||
| ... ) |
Constructs a preallocated property with the given type, name, id, flags, and any optional arguments handled by its optional argument initializer.
| GBL_RESULT GblProperty_constructVaList | ( | GblProperty * | pSelf, |
| GblType | derivedType, | ||
| const char * | pName, | ||
| size_t | id, | ||
| GblFlags | flags, | ||
| size_t | optionalArgCount, | ||
| va_list * | pList ) |
Equivalent to GblProperty_construct(), except taking a va_list rather than variadic argument list.
| GBL_RESULT GblProperty_createOrConstruct | ( | GblProperty ** | ppSelf, |
| GblType | derivedType, | ||
| const char * | pName, | ||
| size_t | id, | ||
| GblFlags | flags, | ||
| size_t | optionalArgCount, | ||
| ... ) |
Either calls GblProperty_create() or GblProperty_construct() based on whether ppSelf points to an existing property or not. If not, it will point to a newly created property, upon success, after the function returns.
| GblType GblProperty_objectType | ( | const GblProperty * | pSelf | ) |
Returns the UUID of the type associated with the given property.
| const char * GblProperty_name | ( | const GblProperty * | pSelf | ) |
Returns the string name of the given property.
| GBL_RESULT GblProperty_defaultValue | ( | const GblProperty * | pSelf, |
| GblVariant * | pValue ) |
Sets the given variant to contain the default value of the given property, calling GblPropertyClass::pFnDefaultValue().
| GblBool GblProperty_checkValue | ( | const GblProperty * | pSelf, |
| const GblVariant * | pValue ) |
Checks whether the value contained by the given variant is valid for the given property, calling GblPropertyClass::pFnCeckValue().
| GBL_RESULT GblProperty_validateValue | ( | const GblProperty * | pSelf, |
| GblVariant * | pValue ) |
Modifies the value contained within the given variant to be a valid value, if possible, calling GblPropertyClass::pFnValidateValue().
| int GblProperty_compareValues | ( | const GblProperty * | pSelf, |
| const GblVariant * | pV1, | ||
| const GblVariant * | pV2 ) |
Compares the values contained by the given variants, based on the rules of the given property, calling GblPropertyClass::pFnCompareValues().