libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_iplugin.h
Go to the documentation of this file.
1/*! \file
2 * \brief GblIPlugin abstract plugin interface
3 * \ingroup interfaces
4 * \sa GblModule
5 * \todo
6 * - finalize with GblModule
7 *
8 * \author 2023 Falco Girgis
9 * \copyright MIT License
10 */
11
12#ifndef GIMBAL_PLUGIN_H
13#define GIMBAL_PLUGIN_H
14
16#include "../instances/gimbal_instance.h"
17
18/*! \name Type System
19 * \brief Type UUID and cast operators
20 * @{
21 */
22#define GBL_IPLUGIN_TYPE (GBL_TYPEID(GblIPlugin))
23#define GBL_IPLUGIN(instance) (GBL_CAST(GblIPlugin, instance))
24#define GBL_IPLUGIN_CLASS(klass) (GBL_CLASS_CAST(GblIPlugin, klass))
25#define GBL_IPLUGIN_GET_CLASS(instance) (GBL_CLASSOF(GblIPlugin, instance))
26//! @}
27
28#define GBL_SELF_TYPE GblIPlugin
29
31
32/*! \struct GblIPluginClass
33 * \extends GblInterface
34 * \brief Interface providing vtable for GblPlugin instances
35 *
36 * GblIPluginClass provides a virtual table of overridable
37 * methods for implementing a plugin for use with the type
38 * system.
39 *
40 * \sa GblModule
41 */
43 GBL_RESULT (*pFnUse) (GBL_SELF);
44 GBL_RESULT (*pFnUnuse) (GBL_SELF);
45 GBL_RESULT (*pFnTypeInfo) (GBL_CSELF,
46 GblType dynamicType,
47 GblTypeInfo* pCompleteInfo);
48 GBL_RESULT (*pFnInterfacePeek)(GBL_CSELF,
49 GblType dynamicType,
50 GblType ifaceType,
51 GblInterface** ppInterface);
53
54GBL_EXPORT GblType GblIPlugin_type (void) GBL_NOEXCEPT;
55
56GBL_EXPORT GBL_RESULT GblIPlugin_use (GBL_SELF) GBL_NOEXCEPT;
57GBL_EXPORT GBL_RESULT GblIPlugin_unuse (GBL_SELF) GBL_NOEXCEPT;
58
59GBL_EXPORT GBL_RESULT GblIPlugin_typeInfo (GBL_CSELF,
60 GblType type,
61 GblTypeInfo* pInfo) GBL_NOEXCEPT;
62
63
65
66#undef GBL_SELF_TYPE
67
68
69#endif // GIMBAL_PLUGIN_H
#define GBL_CLASS_CAST(cType, klass)
#define GBL_NOEXCEPT
#define GBL_DECLS_BEGIN
#define GBL_TYPEID(instanceStruct)
#define GBL_INTERFACE_END
#define GBL_INTERFACE_DERIVE(...)
#define GBL_EXPORT
#define GBL_CLASSOF(cType, self)
#define GBL_CAST(cType, self)
uintptr_t GblType
Meta Type UUID.
Definition gimbal_type.h:51