libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_context.h
Go to the documentation of this file.
1/*! \file
2 * \brief GblContext API management instance type
3 * \ingroup meta
4 * \todo
5 * - get the eff rid of me
6 *
7 * \author Falco Girgis
8 */
9
10#ifndef GIMBAL_CONTEXT_H
11#define GIMBAL_CONTEXT_H
12
13#include "gimbal_object.h"
14#include "../ifaces/gimbal_iallocator.h"
15#include "../ifaces/gimbal_ilogger.h"
16
17/// \ingroup metaBuiltinTypes
18#define GBL_CONTEXT_TYPE (GBL_TYPEID(GblContext))
19#define GBL_CONTEXT(instance) (GBL_CAST(GblContext, instance))
20#define GBL_CONTEXT_CLASS(klass) (GBL_CLASS_CAST(GblContext, klass))
21#define GBL_CONTEXT_GET_CLASS(instance) (GBL_CLASSOF(GblContext, instance))
22
23#define GBL_SELF_TYPE GblContext
24
26
27/*! \struct GblContextClass
28 * \extends GblObjectClass
29 * \implements GblIAllocatorClass
30 * \implements GblILoggerClass
31 * \brief GblClass structure for GblContext
32 *
33 * \deprecated
34 * \todo
35 * - remove me
36 *
37 * \sa GblContext
38 */
39GBL_CLASS_DERIVE_EMPTY(GblContext,
40 GblObject, GblIAllocator, GblILogger)
41
42/*! \struct GblContext
43 * \extends GblObject
44 * \implements GblIAllocator
45 * \implements GblILogger
46 * \brief Top-level context object
47 *
48 * \deprecated
49 * \todo
50 * -remove me
51 * \sa GblContextClass
52 */
54 GblCallRecord lastIssue;
55 uint32_t logStackDepth;
56 GblFlags logFilter;
58
59GBL_PROPERTIES(GblContext,
60 (result, GBL_GENERIC, (READ), GBL_UINT32_TYPE),
61 (message, GBL_GENERIC, (READ), GBL_POINTER_TYPE)
62)
63
64GBL_EXPORT GblType GblContext_type (void) GBL_NOEXCEPT;
65GBL_EXPORT GblContext* GblContext_global (void) GBL_NOEXCEPT;
66GBL_EXPORT void GblContext_setGlobal (GblContext* pCtx) GBL_NOEXCEPT;
67
69 GblContext_lastIssue (GBL_CSELF) GBL_NOEXCEPT;
70GBL_EXPORT GBL_RESULT GblContext_setLastIssue (GBL_SELF, const GblCallRecord* pIssue) GBL_NOEXCEPT;
71GBL_EXPORT GBL_RESULT GblContext_clearLastIssue (GBL_SELF) GBL_NOEXCEPT;
72
73GBL_EXPORT GblBool GblContext_hasIssue (GBL_CSELF) GBL_NOEXCEPT;
74GBL_EXPORT GblBool GblContext_hasError (GBL_CSELF) GBL_NOEXCEPT;
75GBL_EXPORT GBL_RESULT GblContext_lastIssueResult (GBL_CSELF) GBL_NOEXCEPT;
76GBL_EXPORT const char* GblContext_lastIssueMessage (GBL_CSELF) GBL_NOEXCEPT;
77
78GBL_EXPORT GblContext* GblContext_parentContext (GBL_CSELF) GBL_NOEXCEPT;
79GBL_EXPORT void GblContext_setLogFilter (GBL_SELF, GblFlags mask) GBL_NOEXCEPT;
80GBL_EXPORT void GblContext_logBuildInfo (GBL_CSELF) GBL_NOEXCEPT;
81
83
84#undef GBL_SELF_TYPE
85
86
87#endif // GIMBAL_CONTEXT_H
#define GBL_CLASS_CAST(cType, klass)
#define GBL_NOEXCEPT
#define GBL_DECLS_BEGIN
#define GBL_TYPEID(instanceStruct)
#define GBL_INSTANCE_DERIVE(derivedInstance, baseInstance)
#define GBL_INSTANCE_END
#define GBL_CLASS_DERIVE_EMPTY(...)
#define GBL_EXPORT
#define GBL_CLASSOF(cType, self)
#define GBL_CAST(cType, self)
#define GBL_UINT32_TYPE
Builtin ID for uint32_t GblVariant type.
#define GBL_PROPERTIES(object,...)
Declares a list of properties for the given object/instance structure.
uint32_t GblFlags
Standard-sized flags type, 32-bits across platforms.
uint8_t GblBool
Basic boolean type, standardized to sizeof(char)
#define GBL_POINTER_TYPE
uintptr_t GblType
Meta Type UUID.
Definition gimbal_type.h:51
Captures a result, its stringified message, and a source context.
Top-level context object.