libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_primitives.h
Go to the documentation of this file.
1/*! \file
2 * \brief GblPrimitiveClass abstract primitive base plus builtin types
3 * \ingroup meta
4 *
5 * \author Falco Girgis
6 */
7
8#ifndef GIMBAL_PRIMITIVES_H
9#define GIMBAL_PRIMITIVES_H
10
11#include "../types/gimbal_type.h"
12#include "../ifaces/gimbal_ivariant.h"
13#include "../../preprocessor/gimbal_compiler.h"
14
15#define GBL_NIL_TYPE (GBL_BUILTIN_TYPE(NIL)) //!< Builtin ID for nil GblVariant type
16#define GBL_BOOL_TYPE (GBL_BUILTIN_TYPE(BOOL)) //!< Builtin ID for boolean GblVariant type
17#define GBL_CHAR_TYPE (GBL_BUILTIN_TYPE(CHAR)) //!< Builtin ID for char GblVariant type
18#define GBL_UINT8_TYPE (GBL_BUILTIN_TYPE(UINT8)) //!< Builtin ID for uint8_t GblVariant type
19#define GBL_INT16_TYPE (GBL_BUILTIN_TYPE(INT16)) //!< Builtin ID for int16_t GblVariant type
20#define GBL_UINT16_TYPE (GBL_BUILTIN_TYPE(UINT16)) //!< Builtin ID for uint16_t GblVariant type
21#define GBL_INT32_TYPE (GBL_BUILTIN_TYPE(INT32)) //!< Builtin ID for int32_t GblVariant type
22#define GBL_UINT32_TYPE (GBL_BUILTIN_TYPE(UINT32)) //!< Builtin ID for uint32_t GblVariant type
23#define GBL_INT64_TYPE (GBL_BUILTIN_TYPE(INT64)) //!< Builtin ID for int64_t GblVariant type
24#define GBL_UINT64_TYPE (GBL_BUILTIN_TYPE(UINT64)) //!< Builtin ID for uint64_t GblVariant type
25#define GBL_FLOAT_TYPE (GBL_BUILTIN_TYPE(FLOAT)) //!< Builtin ID for float GblVariant type
26#define GBL_DOUBLE_TYPE (GBL_BUILTIN_TYPE(DOUBLE)) //!< Builtin ID for double GblVariant type
27#define GBL_STRING_TYPE (GBL_BUILTIN_TYPE(STRING)) //!< Builtin ID for string GblVariant type
28#define GBL_TYPE_TYPE (GBL_TYPEID(GblType)) //!< Builtin ID for ::GblType GblVariant type
29#define GBL_BITMASK_TYPE (GBL_TYPEID(GblBitMask))
30
31#ifdef GBL_64BIT
32# define GBL_SIZE_TYPE GBL_UINT64_TYPE
33#else
34# define GBL_SIZE_TYPE GBL_UINT32_TYPE
35#endif
36
37#define GblNil_type() GBL_NIL_TYPE
38#define GblBool_type() GBL_BOOL_TYPE
39#define GblChar_type() GBL_CHAR_TYPE
40#define GblUint8_type() GBL_UINT8_TYPE
41#define GblInt16_type() GBL_INT16_TYPE
42#define GblUint16_type() GBL_UINT16_TYPE
43#define GblInt32_type() GBL_INT32_TYPE
44#define GblUint32_type() GBL_UINT32_TYPE
45#define GblInt64_type() GBL_INT64_TYPE
46#define GblUint64_type() GBL_UINT64_TYPE
47#define GblFloat_type() GBL_FLOAT_TYPE
48#define GblDouble_type() GBL_DOUBLE_TYPE
49#define GblString_type() GBL_STRING_TYPE
50#define GblSize_type() GBL_SIZE_TYPE
51
52/*! \struct GblPrimitiveClass
53 * \implements GblIVariantClass
54 * \brief Static GblClass structure for any primitive tyes
55 *
56 * No public members.
57 */
58GBL_CLASS_BASE_EMPTY(GblPrimitive, GblIVariant)
59
60typedef uint64_t GblBitmask;
61
62GBL_EXPORT GblType GblType_type (void) GBL_NOEXCEPT;
63GBL_EXPORT GblType GblBitmask_type (void) GBL_NOEXCEPT;
64
65GBL_EXPORT GblType GblPrimitive_register (const char* pName,
66 size_t classSize,
67 size_t classPrivateSize,
68 const GblIVariantVTable* pIVTable,
69 GblFlags typeFlags) GBL_NOEXCEPT;
70
71GBL_EXPORT GblType GblPrimitive_registerBuiltin
72 (size_t index,
73 const char* pName,
74 size_t classSize,
75 size_t classPrivateSize,
76 const GblIVariantVTable* pIVTable,
77 GblFlags typeFlags) GBL_NOEXCEPT;
78
79
80#endif // GIMBAL_PRIMITIVES_H
#define GBL_BUILTIN_TYPE(prefix)
Returns a type from the macro prefix of a builtin type.
#define GBL_NOEXCEPT
#define GBL_TYPEID(instanceStruct)
#define GBL_CLASS_BASE_EMPTY(...)
#define GBL_EXPORT
#define GBL_NIL_TYPE
Builtin ID for nil GblVariant type.
#define GBL_UINT64_TYPE
Builtin ID for uint64_t GblVariant type.
#define GBL_CHAR_TYPE
Builtin ID for char GblVariant type.
#define GBL_UINT16_TYPE
Builtin ID for uint16_t GblVariant type.
#define GBL_FLOAT_TYPE
Builtin ID for float GblVariant type.
#define GBL_INT16_TYPE
Builtin ID for int16_t GblVariant type.
#define GBL_SIZE_TYPE
#define GBL_STRING_TYPE
Builtin ID for string GblVariant type.
#define GBL_BOOL_TYPE
Builtin ID for boolean GblVariant type.
#define GBL_INT64_TYPE
Builtin ID for int64_t GblVariant type.
#define GBL_DOUBLE_TYPE
Builtin ID for double GblVariant type.
#define GBL_INT32_TYPE
Builtin ID for int32_t GblVariant type.
#define GBL_UINT8_TYPE
Builtin ID for uint8_t GblVariant type.
#define GBL_UINT32_TYPE
Builtin ID for uint32_t GblVariant type.
uint32_t GblFlags
Standard-sized flags type, 32-bits across platforms.
uintptr_t GblType
Meta Type UUID.
Definition gimbal_type.h:51