MkTypeS - various functions to create, initialize and destroy a type … More...
Macros | |
#define | MkTypeCreate(clsV, basicV, identV) |
Functions | |
MK_TYP | libmkkernel::MkTypeCreate (MK_MACRO_TYP const clsV, MK_MACRO_TYP const basicV, MK_STRN const identV) |
create a new type … | |
MK_EXTERN MK_TYP | libmkkernel::MkTypeDup2_RT (MK_RT const mkrt, MK_TYPN const typ, MK_STRN const ident) MK_RT_ATTR_HDL |
duplicate a type-type as duplicate from an existing type but with a new name … | |
MK_EXTERN MK_OBJ | libmkkernel::MkTypeAlloc_RT (MK_RT const mkrt, MK_TYPN const typ) MK_RT_ATTR_HDL |
alloc instance-memory for MkTypeS … | |
MK_EXTERN MK_TYP | libmkkernel::MkTypeResolve_RT (MK_RT const mkrt, MK_TYPN const typ) MK_RT_ATTR_HDL |
resolve a new type | |
MK_EXTERN void | libmkkernel::MkTypeDelete_RT (MK_RT const mkrt, MK_TYP const typ) MK_RT_ATTR_HDL |
delete a type object | |
MkTypeC - MkTypeC_TOR_C_API - overload | |
#define | MkTypeAlloc_NULL(...) |
#define | MkTypeAlloc(...) |
#define | MkTypeDup2_NULL(...) |
#define | MkTypeDup2(...) |
#define | MkTypeResolve_NULL(...) |
#define | MkTypeResolve(...) |
#define | MkTypeDelete_NULL(...) |
#define | MkTypeDelete(...) |
MkTypeS - various functions to create, initialize and destroy a type …
#define MkTypeAlloc | ( | ... | ) |
Definition at line 1780 of file kernel_overload_mk.h.
#define MkTypeAlloc_NULL | ( | ... | ) |
Definition at line 1779 of file kernel_overload_mk.h.
#define MkTypeCreate | ( | clsV, | |
basicV, | |||
identV ) |
Definition at line 4582 of file LibMkKernel_mk.h.
#define MkTypeDelete | ( | ... | ) |
Definition at line 1788 of file kernel_overload_mk.h.
#define MkTypeDelete_NULL | ( | ... | ) |
Definition at line 1787 of file kernel_overload_mk.h.
#define MkTypeDup2 | ( | ... | ) |
Definition at line 1782 of file kernel_overload_mk.h.
#define MkTypeDup2_NULL | ( | ... | ) |
Definition at line 1781 of file kernel_overload_mk.h.
#define MkTypeResolve | ( | ... | ) |
Definition at line 1784 of file kernel_overload_mk.h.
#define MkTypeResolve_NULL | ( | ... | ) |
Definition at line 1783 of file kernel_overload_mk.h.
alloc instance-memory for MkTypeS …
The following steps are done:
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | typ | the MkTypeS instance to work on (nonnull) |
MK_TYP libmkkernel::MkTypeCreate | ( | MK_MACRO_TYP const | clsV, |
MK_MACRO_TYP const | basicV, | ||
MK_STRN const | identV ) |
create a new type …
Ther are three scenarios in which a new type is created:
The shadow-type is used to link a Target-Programming-Language (TPL) with a meta-library. The goal is not to create a new-type but to map an already-existing-type into the Target-Programming-Language (TPL).
A shadow-type is just the already-existing-type extended with MkTypeS::selfCreate and MkTypeS::selfDelete and a link of the TPL-Class-Pointer into MkObjectS::self. The shadow-type has not its own memory and all changes to the shadow-type will change the already-existing-type.
The light-weight-type is created from an already-existing-type and a specific-instance-struct but without an own signature and mask. This type reuse all features of the already-existing-type without replaceing the already-existing-type.
The light-weight-type has its own memory and all changes to the light-weight-type will not change the already-existing-type.
The full-weight-type is created using the MkTypeCreate with a type-class, class-base, type-name.
The type is created as MkTypeDup2 from the basic type followed by an update of the type specific fields objsig, objmask and objsize.
This kind of type is called a full-weight-type, because this type does provide a new signature and mask. In difference to MkTypeCreate the MkTypeDup2 create a lightweight-type.
The fullweight-type is defined by the tool c_Class.tcl
and is able to operate independent from any other type.
[in] | clsV | the real type-name in "C" (usually the same as identV), the type-name who was registerd with the c_CLS.tcl tool. (syntax: NsClassC, Ns=namespace) |
[in] | basicV | the basic-type, have to be MkObjectC or a decend of this |
[in] | identV | the display-name (MkTypeS::type_name), default is the name of the base-class (basicV->type_name). |
example - create a NEW type
definition - of the macro
delete a type object
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | typ | the MkTypeS instance to work on - (nonnull) |
MK_EXTERN MK_TYP libmkkernel::MkTypeDup2_RT | ( | MK_RT const | mkrt, |
MK_TYPN const | typ, | ||
MK_STRN const | ident ) |
duplicate a type-type as duplicate from an existing type but with a new name …
This kind of type is called a lightweight-type, because this type does not provide a new signature and mask. In difference to MkTypeDup2 the MkTypeCreate create a fullweight-type.
call the Dup2-Constructor from the object
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | typ | the MkTypeS instance to work on |
[in] | ident | the display-name (MkTypeS::type_name) of the new type |
resolve a new type
Every NEW runtime require a new Type, This code is called in a callback registered with MkRuntimeCallbackAdd TODO: htmlcode{mqsetting,resolve_example,create a new type and resolve}
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | typ | the MkTypeS instance to work on - (nonnull) |