libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
GblVariant Struct Reference

#include <gimbal_variant.h>

Data Fields

GblType type
 
union { 
 
   char   character 
 
   GblBool   boolean 
 
   uint8_t   u8 
 
   uint16_t   u16 
 
   int16_t   i16 
 
   uint32_t   u32 
 
   int32_t   i32 
 
   uint64_t   u64 
 
   int64_t   i64 
 
   GblEnum   enumeration 
 
   GblFlags   flags 
 
   float   f32 
 
   double   f64 
 
   void *   pVoid 
 
   GBL_RESULT   result 
 
   GblFnPtr   pFnPtr 
 
   GblStringRef *   pString 
 
   GblType   typeValue 
 
   GblBitmask   bitmask 
 
   GblDateTime *   pDateTime 
 
   GblInstance *   pInstance 
 
   GblBox *   pBox 
 
   GblObject *   pObject 
 
};  
 

Related Symbols

(Note that these are not member symbols.)

GblType GblVariant_typeOf (const GblVariant *pSelf)
 
#define GBL_VARIANT_CONSTRUCT_GENERIC_PLATFORM_ENTRIES()
 
Constructors

Methods for various types of construction

GBL_RESULT GblVariant_constructDefault (GblVariant *pSelf, GblType type)
 
GBL_RESULT GblVariant_constructCopy (GblVariant *pSelf, const GblVariant *pOther)
 
GBL_RESULT GblVariant_constructMove (GblVariant *pSelf, GblVariant *pOther)
 
GBL_RESULT GblVariant_constructValueCopy (GblVariant *pSelf, GblType type,...)
 
GBL_RESULT GblVariant_constructValueCopyVa (GblVariant *pSelf, GblType type, va_list *pList)
 
GBL_RESULT GblVariant_constructValueMove (GblVariant *pSelf, GblType type,...)
 
GBL_RESULT GblVariant_constructValueMoveVa (GblVariant *pSelf, GblType type, va_list *pList)
 
GBL_RESULT GblVariant_constructNil (GblVariant *pSelf)
 
GBL_RESULT GblVariant_constructBool (GblVariant *pSelf, GblBool value)
 
GBL_RESULT GblVariant_constructChar (GblVariant *pSelf, char value)
 
GBL_RESULT GblVariant_constructUint8 (GblVariant *pSelf, uint8_t value)
 
GBL_RESULT GblVariant_constructUint16 (GblVariant *pSelf, uint16_t value)
 
GBL_RESULT GblVariant_constructInt16 (GblVariant *pSelf, int16_t value)
 
GBL_RESULT GblVariant_constructUint32 (GblVariant *pSelf, uint32_t value)
 
GBL_RESULT GblVariant_constructInt32 (GblVariant *pSelf, int32_t value)
 
GBL_RESULT GblVariant_constructUint64 (GblVariant *pSelf, uint64_t value)
 
GBL_RESULT GblVariant_constructInt64 (GblVariant *pSelf, int64_t value)
 
GBL_RESULT GblVariant_constructFloat (GblVariant *pSelf, float value)
 
GBL_RESULT GblVariant_constructDouble (GblVariant *pSelf, double value)
 
GBL_RESULT GblVariant_constructString (GblVariant *pSelf, const char *pValue)
 
GBL_RESULT GblVariant_constructStringRef (GblVariant *pSelf, const GblStringRef *pStrRef)
 
GBL_RESULT GblVariant_constructStringView (GblVariant *pSelf, GblStringView value)
 
GBL_RESULT GblVariant_constructTypeValue (GblVariant *pSelf, GblType type)
 
GBL_RESULT GblVariant_constructSize (GblVariant *pSelf, size_t value)
 
GBL_RESULT GblVariant_constructDateTime (GblVariant *pSelf, const GblDateTime *pDateTime)
 
GBL_RESULT GblVariant_constructEnum (GblVariant *pSelf, GblType type, GblEnum value)
 
GBL_RESULT GblVariant_constructFlags (GblVariant *pSelf, GblType type, GblFlags value)
 
GBL_RESULT GblVariant_constructPointer (GblVariant *pSelf, GblType ptrType, void *pValue)
 
GBL_RESULT GblVariant_constructOpaqueCopy (GblVariant *pSelf, GblType opaqueType, void *pValue)
 
GBL_RESULT GblVariant_constructOpaqueMove (GblVariant *pSelf, GblType opaqueType, void *pValue)
 
GBL_RESULT GblVariant_constructInstance (GblVariant *pSelf, GblInstance *pValue)
 
GBL_RESULT GblVariant_constructBoxCopy (GblVariant *pSelf, GblBox *pValue)
 
GBL_RESULT GblVariant_constructBoxMove (GblVariant *pSelf, GblBox *pValue)
 
GBL_RESULT GblVariant_constructObjectCopy (GblVariant *pSelf, GblObject *pObj)
 
GBL_RESULT GblVariant_constructObjectMove (GblVariant *pSelf, GblObject *pObj)
 
GBL_RESULT GblVariant_destruct (GblVariant *pSelf)
 
Setters

Methods for modifying the value of a constructed GblVariant

GBL_RESULT GblVariant_setCopy (GblVariant *pSelf, const GblVariant *pOther)
 
GBL_RESULT GblVariant_setMove (GblVariant *pSelf, GblVariant *pOther)
 
GBL_RESULT GblVariant_setValueCopy (GblVariant *pSelf, GblType type,...)
 
GBL_RESULT GblVariant_setValueCopyVa (GblVariant *pSelf, GblType type, va_list *pVarArgs)
 
GBL_RESULT GblVariant_setValueMove (GblVariant *pSelf, GblType type,...)
 
GBL_RESULT GblVariant_setValueMoveVa (GblVariant *pSelf, GblType type, va_list *pVarArgs)
 
GBL_RESULT GblVariant_invalidate (GblVariant *pSelf)
 
GBL_RESULT GblVariant_setNil (GblVariant *pSelf)
 
GBL_RESULT GblVariant_setBool (GblVariant *pSelf, GblBool value)
 
GBL_RESULT GblVariant_setChar (GblVariant *pSelf, char value)
 
GBL_RESULT GblVariant_setUint8 (GblVariant *pSelf, uint8_t value)
 
GBL_RESULT GblVariant_setUint16 (GblVariant *pSelf, uint16_t value)
 
GBL_RESULT GblVariant_setInt16 (GblVariant *pSelf, int16_t value)
 
GBL_RESULT GblVariant_setUint32 (GblVariant *pSelf, uint32_t value)
 
GBL_RESULT GblVariant_setInt32 (GblVariant *pSelf, int32_t value)
 
GBL_RESULT GblVariant_setUint64 (GblVariant *pSelf, uint64_t value)
 
GBL_RESULT GblVariant_setInt64 (GblVariant *pSelf, int64_t value)
 
GBL_RESULT GblVariant_setFloat (GblVariant *pSelf, float value)
 
GBL_RESULT GblVariant_setDouble (GblVariant *pSelf, double value)
 
GBL_RESULT GblVariant_setString (GblVariant *pSelf, const char *pValue)
 
GBL_RESULT GblVariant_setStringView (GblVariant *pSelf, GblStringView value)
 
GBL_RESULT GblVariant_setStringRef (GblVariant *pSelf, GblStringRef *pRef)
 
GBL_RESULT GblVariant_setTypeValue (GblVariant *pSelf, GblType value)
 
GBL_RESULT GblVariant_setSize (GblVariant *pSelf, size_t value)
 
GBL_RESULT GblVariant_setDateTime (GblVariant *pSelf, const GblDateTime *pDt)
 
GBL_RESULT GblVariant_setEnum (GblVariant *pSelf, GblType enumType, GblEnum value)
 
GBL_RESULT GblVariant_setFlags (GblVariant *pSelf, GblType flagsType, GblFlags value)
 
GBL_RESULT GblVariant_setPointer (GblVariant *pSelf, GblType ptrType, void *pValue)
 
GBL_RESULT GblVariant_setOpaqueCopy (GblVariant *pSelf, GblType opaqueType, void *pValue)
 
GBL_RESULT GblVariant_setOpaqueMove (GblVariant *pSelf, GblType opaqueType, void *pValue)
 
GBL_RESULT GblVariant_setInstance (GblVariant *pSelf, GblInstance *pValue)
 
GBL_RESULT GblVariant_setBoxCopy (GblVariant *pSelf, GblBox *pValue)
 
GBL_RESULT GblVariant_setBoxMove (GblVariant *pSelf, GblBox *pValue)
 
GBL_RESULT GblVariant_setObjectCopy (GblVariant *pSelf, GblObject *pValue)
 
GBL_RESULT GblVariant_setObjectMove (GblVariant *pSelf, GblObject *pValue)
 
Getters

Methods for retrieving the value of a constructed GblVariant

GBL_RESULT GblVariant_valueCopy (const GblVariant *pSelf,...)
 
GBL_RESULT GblVariant_valueCopyVa (const GblVariant *pSelf, va_list *pVa)
 
GBL_RESULT GblVariant_valuePeek (const GblVariant *pSelf,...)
 
GBL_RESULT GblVariant_valuePeekVa (GblVariant *pSelf, va_list *pVa)
 
GBL_RESULT GblVariant_valueMove (GblVariant *pSelf,...)
 
GBL_RESULT GblVariant_valueMoveVa (GblVariant *pSelf, va_list *pVa)
 
GblBool GblVariant_isValid (const GblVariant *pSelf)
 
GblBool GblVariant_isNil (const GblVariant *pSelf)
 
GblBool GblVariant_bool (const GblVariant *pSelf)
 
char GblVariant_char (const GblVariant *pSelf)
 
uint8_t GblVariant_uint8 (const GblVariant *pSelf)
 
uint16_t GblVariant_uint16 (const GblVariant *pSelf)
 
int16_t GblVariant_int16 (const GblVariant *pSelf)
 
uint32_t GblVariant_uint32 (const GblVariant *pSelf)
 
int32_t GblVariant_int32 (const GblVariant *pSelf)
 
uint64_t GblVariant_uint64 (const GblVariant *pSelf)
 
int64_t GblVariant_int64 (const GblVariant *pSelf)
 
GblEnum GblVariant_enum (const GblVariant *pSelf)
 
GblFlags GblVariant_flags (const GblVariant *pSelf)
 
float GblVariant_float (const GblVariant *pSelf)
 
double GblVariant_double (const GblVariant *pSelf)
 
const GblStringRefGblVariant_string (const GblVariant *pSelf)
 
GblStringView GblVariant_stringView (const GblVariant *pSelf)
 
GblType GblVariant_typeValue (const GblVariant *pSelf)
 
void * GblVariant_pointer (const GblVariant *pSelf)
 
size_t GblVariant_size (const GblVariant *pSelf)
 
GblDateTimeGblVariant_dateTime (const GblVariant *pSelf)
 
void * GblVariant_opaqueCopy (const GblVariant *pSelf)
 
void * GblVariant_opaqueMove (GblVariant *pSelf)
 
void * GblVariant_opaquePeek (const GblVariant *pSelf)
 
GblInstanceGblVariant_instance (const GblVariant *pSelf)
 
GblBoxGblVariant_boxCopy (const GblVariant *pSelf)
 
GblBoxGblVariant_boxMove (GblVariant *pSelf)
 
GblBoxGblVariant_boxPeek (const GblVariant *pSelf)
 
GblObjectGblVariant_objectCopy (const GblVariant *pSelf)
 
GblObjectGblVariant_objectMove (GblVariant *pSelf)
 
GblObjectGblVariant_objectPeek (const GblVariant *pSelf)
 
Table Accessors

Methods for managing and manipulating variants as tables

GblVariantGblVariant_index (const GblVariant *pSelf, const GblVariant *pKey, GblVariant *pValue)
 
GblVariantGblVariant_field (const GblVariant *pSelf, const char *pName, GblVariant *pValue)
 
GblVariantGblVariant_element (const GblVariant *pSelf, size_t index, GblVariant *pValue)
 
GBL_RESULT GblVariant_setIndex (GblVariant *pSelf, const GblVariant *pKey, GblVariant *pValue)
 
GBL_RESULT GblVariant_setField (GblVariant *pSelf, const char *pName, GblVariant *pValue)
 
GBL_RESULT GblVariant_setElement (GblVariant *pSelf, size_t index, GblVariant *pValue)
 
GblBool GblVariant_next (const GblVariant *pSelf, GblVariant *pKey, GblVariant *pValue)
 
size_t GblVariant_count (const GblVariant *pSelf)
 
Builtin Conversions

Methods for converting between types

GblBool GblVariant_toBool (GblVariant *pSelf)
 
char GblVariant_toChar (GblVariant *pSelf)
 
uint8_t GblVariant_toUint8 (GblVariant *pSelf)
 
uint16_t GblVariant_toUint16 (GblVariant *pSelf)
 
int16_t GblVariant_toInt16 (GblVariant *pSelf)
 
uint32_t GblVariant_toUint32 (GblVariant *pSelf)
 
int32_t GblVariant_toInt32 (GblVariant *pSelf)
 
uint64_t GblVariant_toUint64 (GblVariant *pSelf)
 
int64_t GblVariant_toInt64 (GblVariant *pSelf)
 
GblEnum GblVariant_toEnum (GblVariant *pSelf)
 
GblFlags GblVariant_toFlags (GblVariant *pSelf)
 
float GblVariant_toFloat (GblVariant *pSelf)
 
double GblVariant_toDouble (GblVariant *pSelf)
 
void * GblVariant_toPointer (GblVariant *pSelf)
 
const GblStringRefGblVariant_toString (GblVariant *pSelf)
 
GblStringView GblVariant_toStringView (GblVariant *pSelf)
 
GblType GblVariant_toTypeValue (GblVariant *pSelf)
 
size_t GblVariant_toSize (GblVariant *pSelf)
 
GblDateTimeGblVariant_toDateTime (GblVariant *pSelf)
 
Generic Conversions

Generic conversion registration and operations

GBL_RESULT GblVariant_registerConverter (GblType fromType, GblType toType, GblVariantConverterFn pFnConv)
 
GBL_RESULT GblVariant_unregisterConverter (GblType fromType, GblType toType)
 
size_t GblVariant_converterCount (void)
 
GblBool GblVariant_canConvert (GblType fromType, GblType toType)
 
GBL_RESULT GblVariant_convert (const GblVariant *pSelf, GblVariant *pToVariant)
 
Utilities

Methods offering various operators and utility functionality

int GblVariant_compare (const GblVariant *pSelf, const GblVariant *pOther)
 
GblBool GblVariant_equals (const GblVariant *pSelf, const GblVariant *pOther)
 
GBL_RESULT GblVariant_save (const GblVariant *pSelf, GblStringBuffer *pString)
 
GBL_RESULT GblVariant_load (GblVariant *pSelf, const GblStringBuffer *pStr)
 
GblHash GblVariant_hash (const GblVariant *pSelf)
 

Detailed Description

Contains a single generic, dynamically typed value.

GblVariant is a type-tagged union capable of representing any type within the type system which implements the GblIVariantClass interface.

For the table-like accessors such as GblVariant_index() and GblVariant_setIndex(), the type must additionally implement the GblITableVariantClass interface.

Warning
All fields within the structure are PRIVATE. You should ALWAYS use the API, which carefully manages lifetimes, conversions, validation, range-checking, and more rather than reaching directly for its members. The exception to this rule is when writing an actual implementation of GblIVariantClass for a type.
See also
GblIVariantClass, GblITableVariantClass

Definition at line 95 of file gimbal_variant.h.

Friends And Related Symbol Documentation

◆ GblVariant_constructDefault()

GBL_RESULT GblVariant_constructDefault ( GblVariant pSelf,
GblType  type 
)
related

Invokes the default constructor for the given type.

◆ GblVariant_constructCopy()

GBL_RESULT GblVariant_constructCopy ( GblVariant pSelf,
const GblVariant pOther 
)
related

Invokes the copy constructor, constructing then copying the pOther variant.

◆ GblVariant_constructMove()

GBL_RESULT GblVariant_constructMove ( GblVariant pSelf,
GblVariant pOther 
)
related

Invokes the move constructor, constructing then moving the pOther variant.

◆ GblVariant_constructValueCopy()

GBL_RESULT GblVariant_constructValueCopy ( GblVariant pSelf,
GblType  type,
  ... 
)
related

Invokes the value copy constructor, constructing then copying the given value.

◆ GblVariant_constructValueCopyVa()

GBL_RESULT GblVariant_constructValueCopyVa ( GblVariant pSelf,
GblType  type,
va_list *  pList 
)
related

va_list* variation of GblVariant_constructValueCopy()

◆ GblVariant_constructValueMove()

GBL_RESULT GblVariant_constructValueMove ( GblVariant pSelf,
GblType  type,
  ... 
)
related

Invokes the value move constructor, constructing then moving the given value.

◆ GblVariant_constructValueMoveVa()

GBL_RESULT GblVariant_constructValueMoveVa ( GblVariant pSelf,
GblType  type,
va_list *  pList 
)
related

va_list* variation of GblVariant_constructValueMove()

◆ GblVariant_constructNil()

GBL_RESULT GblVariant_constructNil ( GblVariant pSelf)
related

Convenience wrapper for value constructing a variant with a NIL value.

◆ GblVariant_constructBool()

GBL_RESULT GblVariant_constructBool ( GblVariant pSelf,
GblBool  value 
)
related

Convenience wrapper for value constructing a variant with a bool value.

◆ GblVariant_constructChar()

GBL_RESULT GblVariant_constructChar ( GblVariant pSelf,
char  value 
)
related

Convenience wrapper for value constructing a variant with a char value.

◆ GblVariant_constructUint8()

GBL_RESULT GblVariant_constructUint8 ( GblVariant pSelf,
uint8_t  value 
)
related

Convenience wrapper for value constructing a variant with a uint8_t value.

◆ GblVariant_constructUint16()

GBL_RESULT GblVariant_constructUint16 ( GblVariant pSelf,
uint16_t  value 
)
related

Convenience wrapper for value constructing a variant with a uint16 value.

◆ GblVariant_constructInt16()

GBL_RESULT GblVariant_constructInt16 ( GblVariant pSelf,
int16_t  value 
)
related

Convenience wrapper for value constructing a variant with an int16 value.

◆ GblVariant_constructUint32()

GBL_RESULT GblVariant_constructUint32 ( GblVariant pSelf,
uint32_t  value 
)
related

Convenience wrapper for value constructing a variant with a uint32 value.

◆ GblVariant_constructInt32()

GBL_RESULT GblVariant_constructInt32 ( GblVariant pSelf,
int32_t  value 
)
related

Convenience wrapper for value constructing a variant with an int32 value.

◆ GblVariant_constructUint64()

GBL_RESULT GblVariant_constructUint64 ( GblVariant pSelf,
uint64_t  value 
)
related

Convenience wrapper for value constructing a variant with a uint64 value.

◆ GblVariant_constructInt64()

GBL_RESULT GblVariant_constructInt64 ( GblVariant pSelf,
int64_t  value 
)
related

Convenience wrapper for value constructing a variant with an int64 value.

◆ GblVariant_constructFloat()

GBL_RESULT GblVariant_constructFloat ( GblVariant pSelf,
float  value 
)
related

Convenience wrapper for value constructing a variant with a float value.

◆ GblVariant_constructDouble()

GBL_RESULT GblVariant_constructDouble ( GblVariant pSelf,
double  value 
)
related

Convenience wrapper for value constructing a variant with a double value.

◆ GblVariant_constructString()

GBL_RESULT GblVariant_constructString ( GblVariant pSelf,
const char *  pValue 
)
related

Convenience wrapper for value copy constructing a variant with a const char*.

◆ GblVariant_constructStringRef()

GBL_RESULT GblVariant_constructStringRef ( GblVariant pSelf,
const GblStringRef pStrRef 
)
related

Convenience wrapper for value move constructing a variant with a GblStringRef (transferring ownership)

◆ GblVariant_constructStringView()

GBL_RESULT GblVariant_constructStringView ( GblVariant pSelf,
GblStringView  value 
)
related

Convenience wrapper for value copy constructing a string variant from a string view.

◆ GblVariant_constructTypeValue()

GBL_RESULT GblVariant_constructTypeValue ( GblVariant pSelf,
GblType  type 
)
related

Convenience wrapper for value constructing a variant from a GblType.

◆ GblVariant_constructSize()

GBL_RESULT GblVariant_constructSize ( GblVariant pSelf,
size_t  value 
)
related

Convenience wrapper for value copy constructing a variant with a size_t.

◆ GblVariant_constructDateTime()

GBL_RESULT GblVariant_constructDateTime ( GblVariant pSelf,
const GblDateTime pDateTime 
)
related

Convenience wrapper for value copy constructing a variant with a GblDateTime.

◆ GblVariant_constructEnum()

GBL_RESULT GblVariant_constructEnum ( GblVariant pSelf,
GblType  type,
GblEnum  value 
)
related

Convenience wrapper for value constructing an enum derived variant with its value.

◆ GblVariant_constructFlags()

GBL_RESULT GblVariant_constructFlags ( GblVariant pSelf,
GblType  type,
GblFlags  value 
)
related

Convenience wrapper for value constructing a flags-derived variant with its value.

◆ GblVariant_constructPointer()

GBL_RESULT GblVariant_constructPointer ( GblVariant pSelf,
GblType  ptrType,
void *  pValue 
)
related

Convenience wrapper for value constructing a pointer-derived variant with its value.

◆ GblVariant_constructOpaqueCopy()

GBL_RESULT GblVariant_constructOpaqueCopy ( GblVariant pSelf,
GblType  opaqueType,
void *  pValue 
)
related

Convenience wrapper for value copy constructing a variant from an opaque-derived type pointer.

◆ GblVariant_constructOpaqueMove()

GBL_RESULT GblVariant_constructOpaqueMove ( GblVariant pSelf,
GblType  opaqueType,
void *  pValue 
)
related

Convenience wrapper for value move constructing a variant from an opaque-derived type pointer.

◆ GblVariant_constructInstance()

GBL_RESULT GblVariant_constructInstance ( GblVariant pSelf,
GblInstance pValue 
)
related

Convenience wrapper for value constructing a variant from a GblInstance pointer.

◆ GblVariant_constructBoxCopy()

GBL_RESULT GblVariant_constructBoxCopy ( GblVariant pSelf,
GblBox pValue 
)
related

Convenience wrapper for value copy constructing a variant from a GblBox, increasing its refCount.

◆ GblVariant_constructBoxMove()

GBL_RESULT GblVariant_constructBoxMove ( GblVariant pSelf,
GblBox pValue 
)
related

Convenience wrapper for value move constructing a variant from a GblBox, taking ownership of the reference.

◆ GblVariant_constructObjectCopy()

GBL_RESULT GblVariant_constructObjectCopy ( GblVariant pSelf,
GblObject pObj 
)
related

Convenience wrapper for value copy constructing a variant from a GblObject, increasing its refCount.

◆ GblVariant_constructObjectMove()

GBL_RESULT GblVariant_constructObjectMove ( GblVariant pSelf,
GblObject pObj 
)
related

Convenience wrapper for value m ove constructing a variant from a GblObject, taking ownership of the reference.

◆ GblVariant_destruct()

GBL_RESULT GblVariant_destruct ( GblVariant pSelf)
related

Destroys the given variant, invoking its destructor and resetting its type and value.

◆ GblVariant_setCopy()

GBL_RESULT GblVariant_setCopy ( GblVariant pSelf,
const GblVariant pOther 
)
related

Performs a copy assignment operation, setting pOther to the given variant's value.

◆ GblVariant_setMove()

GBL_RESULT GblVariant_setMove ( GblVariant pSelf,
GblVariant pOther 
)
related

Performs a move assignment operation, moving the given variant's value into pOther.

◆ GblVariant_setValueCopy()

GBL_RESULT GblVariant_setValueCopy ( GblVariant pSelf,
GblType  type,
  ... 
)
related

Performs a generic value copy assignment operation, copying the variadic argument into the variant.

◆ GblVariant_setValueCopyVa()

GBL_RESULT GblVariant_setValueCopyVa ( GblVariant pSelf,
GblType  type,
va_list *  pVarArgs 
)
related

va_list* variation of GblVariant_setValueCopy(), where the value is sourdced from a va_list*

◆ GblVariant_setValueMove()

GBL_RESULT GblVariant_setValueMove ( GblVariant pSelf,
GblType  type,
  ... 
)
related

Performs a generic value move assignment operation, moving the variadic argument into the variant.

◆ GblVariant_setValueMoveVa()

GBL_RESULT GblVariant_setValueMoveVa ( GblVariant pSelf,
GblType  type,
va_list *  pVarArgs 
)
related

va_list* variation of GblVariant_setValueMove(), where the value is sourced from a va_list*

◆ GblVariant_invalidate()

GBL_RESULT GblVariant_invalidate ( GblVariant pSelf)
related

Clears and resets the given variants type and value. ONLY call after being the source of a move operation!

◆ GblVariant_setNil()

GBL_RESULT GblVariant_setNil ( GblVariant pSelf)
related

Convenience wrapper assigning the value of a constructed variant to NIL.

◆ GblVariant_setBool()

GBL_RESULT GblVariant_setBool ( GblVariant pSelf,
GblBool  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a boolean.

◆ GblVariant_setChar()

GBL_RESULT GblVariant_setChar ( GblVariant pSelf,
char  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a character.

◆ GblVariant_setUint8()

GBL_RESULT GblVariant_setUint8 ( GblVariant pSelf,
uint8_t  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a uint8.

◆ GblVariant_setUint16()

GBL_RESULT GblVariant_setUint16 ( GblVariant pSelf,
uint16_t  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a uint16.

◆ GblVariant_setInt16()

GBL_RESULT GblVariant_setInt16 ( GblVariant pSelf,
int16_t  value 
)
related

Convenience wrapper assigning the value of a constructed variant to an int16.

◆ GblVariant_setUint32()

GBL_RESULT GblVariant_setUint32 ( GblVariant pSelf,
uint32_t  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a uint32.

◆ GblVariant_setInt32()

GBL_RESULT GblVariant_setInt32 ( GblVariant pSelf,
int32_t  value 
)
related

Convenience wrapper assigning the value of a constructed variant to an int32.

◆ GblVariant_setUint64()

GBL_RESULT GblVariant_setUint64 ( GblVariant pSelf,
uint64_t  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a uint64.

◆ GblVariant_setInt64()

GBL_RESULT GblVariant_setInt64 ( GblVariant pSelf,
int64_t  value 
)
related

Convenience wrapper assigning the value of a constructed variant to an int64.

◆ GblVariant_setFloat()

GBL_RESULT GblVariant_setFloat ( GblVariant pSelf,
float  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a float.

◆ GblVariant_setDouble()

GBL_RESULT GblVariant_setDouble ( GblVariant pSelf,
double  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a double.

◆ GblVariant_setString()

GBL_RESULT GblVariant_setString ( GblVariant pSelf,
const char *  pValue 
)
related

Convenience wrapper assigning the value of a constructed variant to a copy of the given string.

◆ GblVariant_setStringView()

GBL_RESULT GblVariant_setStringView ( GblVariant pSelf,
GblStringView  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a copy of the given string view.

◆ GblVariant_setStringRef()

GBL_RESULT GblVariant_setStringRef ( GblVariant pSelf,
GblStringRef pRef 
)
related

Convenience wrapper move assigning the value of a constructed variant to take the given reference.

◆ GblVariant_setTypeValue()

GBL_RESULT GblVariant_setTypeValue ( GblVariant pSelf,
GblType  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a GblType.

◆ GblVariant_setSize()

GBL_RESULT GblVariant_setSize ( GblVariant pSelf,
size_t  value 
)
related

Convenience wrapper assigning the value of a constructed variant to a size_t.

◆ GblVariant_setDateTime()

GBL_RESULT GblVariant_setDateTime ( GblVariant pSelf,
const GblDateTime pDt 
)
related

Convenience wrapper copy assigning the value of a constructed variant to a GblDateTime*.

◆ GblVariant_setEnum()

GBL_RESULT GblVariant_setEnum ( GblVariant pSelf,
GblType  enumType,
GblEnum  value 
)
related

Convenience wrapper assigning the value of a constructed variant to that of an enum-derived type.

◆ GblVariant_setFlags()

GBL_RESULT GblVariant_setFlags ( GblVariant pSelf,
GblType  flagsType,
GblFlags  value 
)
related

Convenience wrapper assigning the value of a constructed variant to that of a GblFlags-derived type.

◆ GblVariant_setPointer()

GBL_RESULT GblVariant_setPointer ( GblVariant pSelf,
GblType  ptrType,
void *  pValue 
)
related

Convenience wrapper assigning the value of a constructed variant to that of a pointer-derived type.

◆ GblVariant_setOpaqueCopy()

GBL_RESULT GblVariant_setOpaqueCopy ( GblVariant pSelf,
GblType  opaqueType,
void *  pValue 
)
related

Convenience wrapper copy assigning the value of a constructed variant to that of an opaque-derived type.

◆ GblVariant_setOpaqueMove()

GBL_RESULT GblVariant_setOpaqueMove ( GblVariant pSelf,
GblType  opaqueType,
void *  pValue 
)
related

Convenience wrapper move assigning the value of a constructed variant to that of an opaque-derived type.

◆ GblVariant_setInstance()

GBL_RESULT GblVariant_setInstance ( GblVariant pSelf,
GblInstance pValue 
)
related

Convenience wrapper assigning the value of a GblVariant to a GblInstance*.

◆ GblVariant_setBoxCopy()

GBL_RESULT GblVariant_setBoxCopy ( GblVariant pSelf,
GblBox pValue 
)
related

Convenience wrapper which assigns the value of the given variant to that of a new reference to a GblBox.

◆ GblVariant_setBoxMove()

GBL_RESULT GblVariant_setBoxMove ( GblVariant pSelf,
GblBox pValue 
)
related

Convenience wrapper which assigns the value of the given variant to take ownership of a GblBox reference.

◆ GblVariant_setObjectCopy()

GBL_RESULT GblVariant_setObjectCopy ( GblVariant pSelf,
GblObject pValue 
)
related

Convenience wrapper which assigns the value of the given variant to that of a new reference to a GblObject.

◆ GblVariant_setObjectMove()

GBL_RESULT GblVariant_setObjectMove ( GblVariant pSelf,
GblObject pValue 
)
related

Convenience wrapper which assings the value of the given variant to take ownership of a GblBox reference.

◆ GblVariant_typeOf()

GblType GblVariant_typeOf ( const GblVariant pSelf)
related

Retrieves the name of the type of value contained by the given variant.

◆ GblVariant_valueCopy()

GBL_RESULT GblVariant_valueCopy ( const GblVariant pSelf,
  ... 
)
related

Attempts to retrieve a copy of the variant's value and store it into the provided pointer.

◆ GblVariant_valueCopyVa()

GBL_RESULT GblVariant_valueCopyVa ( const GblVariant pSelf,
va_list *  pVa 
)
related

va_list* variant of GblVariant_valueCopy(), where the destination pointer comes from a va_list*

◆ GblVariant_valuePeek()

GBL_RESULT GblVariant_valuePeek ( const GblVariant pSelf,
  ... 
)
related

Attempts to retrieve the actual value stored within the variant and store it into the provided pointer (no movement or copying)

◆ GblVariant_valuePeekVa()

GBL_RESULT GblVariant_valuePeekVa ( GblVariant pSelf,
va_list *  pVa 
)
related

va_list* variant of GblVariant_valuePeek(), where destination pointer comes from a va_list*

◆ GblVariant_valueMove()

GBL_RESULT GblVariant_valueMove ( GblVariant pSelf,
  ... 
)
related

Attempts to move the value stored within the variant out of it and into the provided pointer.

◆ GblVariant_valueMoveVa()

GBL_RESULT GblVariant_valueMoveVa ( GblVariant pSelf,
va_list *  pVa 
)
related

va_list* variant of GblVariant_valueMove(), where destination pointer comes from a va_list*

◆ GblVariant_isValid()

GblBool GblVariant_isValid ( const GblVariant pSelf)
related

Returns GBL_TRUE if the value held by the given variant is not of GBL_INVALID_TYPE.

◆ GblVariant_isNil()

GblBool GblVariant_isNil ( const GblVariant pSelf)
related

Returns GBL_TRUE if the value held by the variant is not of type GBL_NIL_TYPE.

◆ GblVariant_bool()

GblBool GblVariant_bool ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a bool, raising an error upon type mismatch.

◆ GblVariant_char()

char GblVariant_char ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a char, raising an error upon type mismatch.

◆ GblVariant_uint8()

uint8_t GblVariant_uint8 ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a uint8, raising an error upon type mismatch.

◆ GblVariant_uint16()

uint16_t GblVariant_uint16 ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a uint16, raising an error upon type mismatch.

◆ GblVariant_int16()

int16_t GblVariant_int16 ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as an int16, raising an error upon type mismatch.

◆ GblVariant_uint32()

uint32_t GblVariant_uint32 ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a uint32, raising an error upon type mismatch.

◆ GblVariant_int32()

int32_t GblVariant_int32 ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as an int32, raising an error upon type mismatch.

◆ GblVariant_uint64()

uint64_t GblVariant_uint64 ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a uint64, raising an error upon type mismatch.

◆ GblVariant_int64()

int64_t GblVariant_int64 ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as an int64, raising an error upon type mismatch.

◆ GblVariant_enum()

GblEnum GblVariant_enum ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a generic enum value, raising an error upon type mismatch.

◆ GblVariant_flags()

GblFlags GblVariant_flags ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a generic GblFlags value, raising an error upon type mismatch.

◆ GblVariant_float()

float GblVariant_float ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a float, raising an error upon type mismatch.

◆ GblVariant_double()

double GblVariant_double ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a double, raising an error upon type mismatch.

◆ GblVariant_string()

const GblStringRef * GblVariant_string ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a string, raising an error upon type mismatch.

◆ GblVariant_stringView()

GblStringView GblVariant_stringView ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a string, returning it within a view, raising an error upon type mismatch.

◆ GblVariant_typeValue()

GblType GblVariant_typeValue ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a GblType, raising an error upon type mismatch.

◆ GblVariant_pointer()

void * GblVariant_pointer ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a generic pointer, raising an error upon type mismatch.

◆ GblVariant_size()

size_t GblVariant_size ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a size_t, raising an error upon type mismatch.

◆ GblVariant_dateTime()

GblDateTime * GblVariant_dateTime ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a GblDateTime, raising an error upon type mismatch.

◆ GblVariant_opaqueCopy()

void * GblVariant_opaqueCopy ( const GblVariant pSelf)
related

Attempst to fetch a copy of the value of the variant as a generic opaque pointer, raising an error upon type mismatch.

◆ GblVariant_opaqueMove()

void * GblVariant_opaqueMove ( GblVariant pSelf)
related

Attempst to take the value of the variant (claiming ownerships) as a generic opaque pointer, raising an error upon type mismatch.

◆ GblVariant_opaquePeek()

void * GblVariant_opaquePeek ( const GblVariant pSelf)
related

Attempst to fetch the value of the variant as a generic opaque pointer, raising an error upon type mismatch.

◆ GblVariant_instance()

GblInstance * GblVariant_instance ( const GblVariant pSelf)
related

Attempts to fetch the value of the variant as a GblInstance derived type, returning a pointer to it.

◆ GblVariant_boxCopy()

GblBox * GblVariant_boxCopy ( const GblVariant pSelf)
related

Attempts to fetch a copy of the value of the variant by making a new generic GblBox reference, raising an error upon type mismatch.

◆ GblVariant_boxMove()

GblBox * GblVariant_boxMove ( GblVariant pSelf)
related

Attempts to take the value stored within the variant as generic GblBox pointer, claiming ownerships of it.

◆ GblVariant_boxPeek()

GblBox * GblVariant_boxPeek ( const GblVariant pSelf)
related

Attempts to fetch the value stored within the variant as a pointer to a GblBox derived type.

◆ GblVariant_objectCopy()

GblObject * GblVariant_objectCopy ( const GblVariant pSelf)
related

Attempts to fetch a copy of the value of the variant by making a new generic GblObject reference, raising an error upon type mismatch.

◆ GblVariant_objectMove()

GblObject * GblVariant_objectMove ( GblVariant pSelf)
related

Attempts to take the value stored within the variant as generic GblObject pointer, claiming ownerships of it.

◆ GblVariant_objectPeek()

GblObject * GblVariant_objectPeek ( const GblVariant pSelf)
related

Attempts to fetch the value stored within the variant as a pointer to a GblObject derived type.

◆ GblVariant_index()

GblVariant * GblVariant_index ( const GblVariant pSelf,
const GblVariant pKey,
GblVariant pValue 
)
related

Looks up the table entry with the given pKey, storing its value in pValue and also returning it.

◆ GblVariant_field()

GblVariant * GblVariant_field ( const GblVariant pSelf,
const char *  pName,
GblVariant pValue 
)
related

Looks up the talbe entry with the given string key, storing its value in pValue and also returning it.

◆ GblVariant_element()

GblVariant * GblVariant_element ( const GblVariant pSelf,
size_t  index,
GblVariant pValue 
)
related

Looks up the table entry with the given integral key, storing its value in pValue and also returning it.

◆ GblVariant_setIndex()

GBL_RESULT GblVariant_setIndex ( GblVariant pSelf,
const GblVariant pKey,
GblVariant pValue 
)
related

Sets the value of the table entry with the corresponding GblVariant key to pValue, returning a status code.

◆ GblVariant_setField()

GBL_RESULT GblVariant_setField ( GblVariant pSelf,
const char *  pName,
GblVariant pValue 
)
related

Sets the value of the table entry with the corresponding string key to pValue, returning a status code.

◆ GblVariant_setElement()

GBL_RESULT GblVariant_setElement ( GblVariant pSelf,
size_t  index,
GblVariant pValue 
)
related

Sets the value of the table entry with the corresponding integral key to pValue, returning a status code.

◆ GblVariant_next()

GblBool GblVariant_next ( const GblVariant pSelf,
GblVariant pKey,
GblVariant pValue 
)
related

Given the current entry's key (or NIL for the first iteration), sets the next key as well as its value, returning GBL_FALSE after the final entry.

◆ GblVariant_count()

size_t GblVariant_count ( const GblVariant pSelf)
related

Returns the number of table entries within the given GblVariant.

◆ GblVariant_toBool()

GblBool GblVariant_toBool ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to bool and return its value.

◆ GblVariant_toChar()

char GblVariant_toChar ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to char and return its value.

◆ GblVariant_toUint8()

uint8_t GblVariant_toUint8 ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to uint8 and return its value.

◆ GblVariant_toUint16()

uint16_t GblVariant_toUint16 ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to uint16 and return its value.

◆ GblVariant_toInt16()

int16_t GblVariant_toInt16 ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to int16 and return its value.

◆ GblVariant_toUint32()

uint32_t GblVariant_toUint32 ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to uint32 and return its value.

◆ GblVariant_toInt32()

int32_t GblVariant_toInt32 ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to int32 and return its value.

◆ GblVariant_toUint64()

uint64_t GblVariant_toUint64 ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to uint64 and return its value.

◆ GblVariant_toInt64()

int64_t GblVariant_toInt64 ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to int64 and return its value.

◆ GblVariant_toEnum()

GblEnum GblVariant_toEnum ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to a generic enum and return its value.

◆ GblVariant_toFlags()

GblFlags GblVariant_toFlags ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to a generic GblFlags and return its value.

◆ GblVariant_toFloat()

float GblVariant_toFloat ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to float and return its value.

◆ GblVariant_toDouble()

double GblVariant_toDouble ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to double and return its value.

◆ GblVariant_toPointer()

void * GblVariant_toPointer ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to pointer and return its value.

◆ GblVariant_toString()

const GblStringRef * GblVariant_toString ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to string and return its value.

◆ GblVariant_toStringView()

GblStringView GblVariant_toStringView ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to string view and return its value.

◆ GblVariant_toTypeValue()

GblType GblVariant_toTypeValue ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to GblType and return its value.

◆ GblVariant_toSize()

size_t GblVariant_toSize ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to size_t and return its value.

◆ GblVariant_toDateTime()

GblDateTime * GblVariant_toDateTime ( GblVariant pSelf)
related

Convenience method that attempts to convert the variant's type to GblDateTime and return its value.

◆ GblVariant_registerConverter()

GBL_RESULT GblVariant_registerConverter ( GblType  fromType,
GblType  toType,
GblVariantConverterFn  pFnConv 
)
related

Registers a converter with the type system for going from one type of variant to another.

◆ GblVariant_unregisterConverter()

GBL_RESULT GblVariant_unregisterConverter ( GblType  fromType,
GblType  toType 
)
related

Unregisters a converter with the type system from going from one type to another type of variant.

◆ GblVariant_converterCount()

size_t GblVariant_converterCount ( void  )
related

Retrieves the current number of type conversion routines held by the type registry.

◆ GblVariant_canConvert()

GblBool GblVariant_canConvert ( GblType  fromType,
GblType  toType 
)
related

Returns GBL_TRUE if a method can be found to convert from one type to another type of variant.

◆ GblVariant_convert()

GBL_RESULT GblVariant_convert ( const GblVariant pSelf,
GblVariant pToVariant 
)
related

Fills pToVariant with the value of pSelf, converted to the type contained by pToVariant.

◆ GblVariant_compare()

int GblVariant_compare ( const GblVariant pSelf,
const GblVariant pOther 
)
related

Peforms a comparison between the two types of variants, implicitly converting between them if necessary.

◆ GblVariant_equals()

GblBool GblVariant_equals ( const GblVariant pSelf,
const GblVariant pOther 
)
related

Returns GBL_TRUE if the result of the comparison between two variants is 0 (meaning both equal)

◆ GblVariant_save()

GBL_RESULT GblVariant_save ( const GblVariant pSelf,
GblStringBuffer pString 
)
related

Attempts to serialize the value stored within the given variant to a GblStringBuffer.

◆ GblVariant_load()

GBL_RESULT GblVariant_load ( GblVariant pSelf,
const GblStringBuffer pStr 
)
related

Attempts to deserialize a value within a GblStringBuffer to store within the given variant.

◆ GblVariant_hash()

GblHash GblVariant_hash ( const GblVariant pSelf)
related

Calculates a 32-bit hash value corresponding to the given variant's value.

◆ GBL_VARIANT_CONSTRUCT_GENERIC_PLATFORM_ENTRIES

#define GBL_VARIANT_CONSTRUCT_GENERIC_PLATFORM_ENTRIES ( )
related

Definition at line 537 of file gimbal_variant.h.

Field Documentation

◆ type

GblType GblVariant::type

GblType UUID.

Definition at line 96 of file gimbal_variant.h.

◆ character

char GblVariant::character

char value

Definition at line 98 of file gimbal_variant.h.

◆ boolean

GblBool GblVariant::boolean

boolean value

Definition at line 99 of file gimbal_variant.h.

◆ u8

uint8_t GblVariant::u8

uint8_t value

Definition at line 100 of file gimbal_variant.h.

◆ u16

uint16_t GblVariant::u16

uint16_t value

Definition at line 101 of file gimbal_variant.h.

◆ i16

int16_t GblVariant::i16

int16_t value

Definition at line 102 of file gimbal_variant.h.

◆ u32

uint32_t GblVariant::u32

uint32_t value

Definition at line 103 of file gimbal_variant.h.

◆ i32

int32_t GblVariant::i32

int32_t value

Definition at line 104 of file gimbal_variant.h.

◆ u64

uint64_t GblVariant::u64

uint64_t value

Definition at line 105 of file gimbal_variant.h.

◆ i64

int64_t GblVariant::i64

int64_t value

Definition at line 106 of file gimbal_variant.h.

◆ enumeration

GblEnum GblVariant::enumeration

enum value

Definition at line 107 of file gimbal_variant.h.

◆ flags

GblFlags GblVariant::flags

GblFlags value.

Definition at line 108 of file gimbal_variant.h.

◆ f32

float GblVariant::f32

float avlue

Definition at line 109 of file gimbal_variant.h.

◆ f64

double GblVariant::f64

double value

Definition at line 110 of file gimbal_variant.h.

◆ pVoid

void* GblVariant::pVoid

void* value

Definition at line 111 of file gimbal_variant.h.

◆ result

GBL_RESULT GblVariant::result

GBL_RESULT value.

Definition at line 112 of file gimbal_variant.h.

◆ pFnPtr

GblFnPtr GblVariant::pFnPtr

function pointer value

Definition at line 113 of file gimbal_variant.h.

◆ pString

GblStringRef* GblVariant::pString

GblStringRef value.

Definition at line 114 of file gimbal_variant.h.

◆ typeValue

GblType GblVariant::typeValue

GblType value.

Definition at line 115 of file gimbal_variant.h.

◆ bitmask

GblBitmask GblVariant::bitmask

GblBitmask value.

Definition at line 116 of file gimbal_variant.h.

◆ pDateTime

GblDateTime* GblVariant::pDateTime

GblDateTime value.

Definition at line 117 of file gimbal_variant.h.

◆ pInstance

GblInstance* GblVariant::pInstance

GblInstance* value.

Definition at line 118 of file gimbal_variant.h.

◆ pBox

GblBox* GblVariant::pBox

GblBox* value.

Definition at line 119 of file gimbal_variant.h.

◆ pObject

GblObject* GblVariant::pObject

GblObject* value.

Definition at line 120 of file gimbal_variant.h.


The documentation for this struct was generated from the following file: