.. _stdlib_templates_boost: ============================ Template application helpers ============================ .. das:module:: templates_boost The TEMPLATES_BOOST module extends template utilities with high-level macros for common code generation patterns, including template function generation, type-parameterized struct creation, and compile-time code expansion. See also :doc:`templates` for ``decltype`` and ``[template]`` annotations. All functions and symbols are in "templates_boost" module, use require to get access to it. .. code-block:: das require daslib/templates_boost ++++++++++ Structures ++++++++++ .. _struct-templates_boost-Template: .. das:attribute:: Template This structure contains collection of substitution rules for a template. :Fields: * **kaboomVar** : table> - variable field access replacement rules * **call2name** : table - call name replacement rules * **field2name** : table - field name replacement rules * **var2name** : table - variable name replacement rules * **var2expr** : table`?> - variable expression replacement rules * **var2exprList** : table`?>> - variable expression list replacement rules * **type2type** : table - type name replacement rules * **type2etype** : table`> - type to type declaration replacement rules * **struct2etype** : table< :ref:`Structure `?; :ref:`TypeDeclPtr `> - structure to type declaration replacement rules * **blockArgName** : table - block argument name replacement rules * **annArg** : table`):void>> - annotation argument replacement rules * **blkArg** : table`>> - block argument replacement rules * **tag2expr** : table`?> - tag expression replacement rules +++++++++++ Call macros +++++++++++ .. _call-macro-templates_boost-qmacro_block: .. das:attribute:: qmacro_block This macro implements expression block reification 'qmacro_block' .. _call-macro-templates_boost-qmacro_expr: .. das:attribute:: qmacro_expr This macro implements first line of the expression block reification 'qmacro_expr' .. _call-macro-templates_boost-qmacro_template_function: .. das:attribute:: qmacro_template_function Call macro for quoting named template functions. This macro implements expression reification for the named expressions (function, variable, etc.) .. _call-macro-templates_boost-qmacro: .. das:attribute:: qmacro This macro implements expression reification 'qmacro' .. _call-macro-templates_boost-qmacro_method: .. das:attribute:: qmacro_method This macro implements expression reification for class methods. .. _call-macro-templates_boost-qmacro_type: .. das:attribute:: qmacro_type This macro implements type declaration reification 'qmacro_type' .. _call-macro-templates_boost-qmacro_function: .. das:attribute:: qmacro_function This macro implements expression reification for functions. .. _call-macro-templates_boost-qmacro_variable: .. das:attribute:: qmacro_variable This macro implements expression reification for variables. .. _call-macro-templates_boost-qmacro_template_class: .. das:attribute:: qmacro_template_class Call macro for quoting named template class methods. This macro implements expression reification for the named expressions (function, variable, etc.) .. _call-macro-templates_boost-qmacro_block_to_array: .. das:attribute:: qmacro_block_to_array This macro implements expression block to array reification 'qmacro_block_to_array' ++++++++++++++ Template rules ++++++++++++++ * :ref:`kaboomVarField (var self: Template; name: string; prefix: string; suffix: string) ` * :ref:`renameCall (var self: Template; name: string; newName: string) ` * :ref:`renameCall (var self: Template; name: string; newName: das_string) ` * :ref:`renameField (var self: Template; name: string; newName: string) ` * :ref:`renameField (var self: Template; name: string; newName: das_string) ` * :ref:`renameVariable (var self: Template; name: string; newName: string) ` * :ref:`renameVariable (var self: Template; name: string; newName: das_string) ` * :ref:`replaceAnnotationArgument (var self: Template; name: string; var cb: lambda\<(var ann:AnnotationDeclaration):void\>) ` * :ref:`replaceArgumentWithList (var self: Template; name: string; blka: array\) ` * :ref:`replaceBlockArgument (var self: Template; name: string; newName: string) ` * :ref:`replaceStructWithTypeDecl (var self: Template; pstruct: Structure?; var expr: TypeDeclPtr) ` * :ref:`replaceType (var self: Template; name: string; newName: string) ` * :ref:`replaceTypeWithTypeDecl (var self: Template; name: string; var expr: TypeDeclPtr) ` * :ref:`replaceVarTag (var self: Template; name: string; var expr: Expression?) ` * :ref:`replaceVariable (var self: Template; name: string; var expr: Expression?) ` * :ref:`replaceVariableWithList (var self: Template; name: string; expr: dasvector`ptr`Expression) ` * :ref:`replaceVariableWithList (var self: Template; name: string; expr: array\) ` .. _function-templates_boost_kaboomVarField_Template_string_string_string: .. das:function:: kaboomVarField(self: Template; name: string; prefix: string; suffix: string) Adds a rule to to the template to replace a variable field access with a prefix and suffix. I.e. foo.bar into prefix + bar + suffix :Arguments: * **self** : :ref:`Template ` * **name** : string * **prefix** : string * **suffix** : string renameCall ^^^^^^^^^^ .. _function-templates_boost_renameCall_Template_string_string: .. das:function:: renameCall(self: Template; name: string; newName: string) Adds a rule to the template to rename a call. :Arguments: * **self** : :ref:`Template ` * **name** : string * **newName** : string .. _function-templates_boost_renameCall_Template_string_das_string: .. das:function:: renameCall(self: Template; name: string; newName: das_string) ---- renameField ^^^^^^^^^^^ .. _function-templates_boost_renameField_Template_string_string: .. das:function:: renameField(self: Template; name: string; newName: string) Adds a rule to the template to rename any field lookup (., ?., as, is, etc) :Arguments: * **self** : :ref:`Template ` * **name** : string * **newName** : string .. _function-templates_boost_renameField_Template_string_das_string: .. das:function:: renameField(self: Template; name: string; newName: das_string) ---- renameVariable ^^^^^^^^^^^^^^ .. _function-templates_boost_renameVariable_Template_string_string: .. das:function:: renameVariable(self: Template; name: string; newName: string) Adds a rule to the template to rename a variable. :Arguments: * **self** : :ref:`Template ` * **name** : string * **newName** : string .. _function-templates_boost_renameVariable_Template_string_das_string: .. das:function:: renameVariable(self: Template; name: string; newName: das_string) ---- .. _function-templates_boost_replaceAnnotationArgument_Template_string_lambda_ls_var_ann_c_AnnotationDeclaration_c_void_gr_: .. das:function:: replaceAnnotationArgument(self: Template; name: string; cb: lambda<(var ann:AnnotationDeclaration):void>) Adds a rule to the template to replace an annotation argument with the result of a callback. :Arguments: * **self** : :ref:`Template ` * **name** : string * **cb** : lambda<(ann: :ref:`AnnotationDeclaration `):void> .. _function-templates_boost_replaceArgumentWithList_Template_string_array_ls_VariablePtr_gr_: .. das:function:: replaceArgumentWithList(self: Template; name: string; blka: array) Adds a rule to the template to replace a block argument with a list of variables. :Arguments: * **self** : :ref:`Template ` * **name** : string * **blka** : array< :ref:`VariablePtr `> .. _function-templates_boost_replaceBlockArgument_Template_string_string: .. das:function:: replaceBlockArgument(self: Template; name: string; newName: string) Adds a rule to the template to rename a block argument. :Arguments: * **self** : :ref:`Template ` * **name** : string * **newName** : string .. _function-templates_boost_replaceStructWithTypeDecl_Template_Structure_q__TypeDeclPtr: .. das:function:: replaceStructWithTypeDecl(self: Template; pstruct: Structure?; expr: TypeDeclPtr) Adds a rule to the template to replace a type alias with another type alias, specified by type declaration. :Arguments: * **self** : :ref:`Template ` * **pstruct** : :ref:`Structure `? * **expr** : :ref:`TypeDeclPtr ` .. _function-templates_boost_replaceType_Template_string_string: .. das:function:: replaceType(self: Template; name: string; newName: string) Adds a rule to the template to replace a type alias with another type alias, specified by name. :Arguments: * **self** : :ref:`Template ` * **name** : string * **newName** : string .. _function-templates_boost_replaceTypeWithTypeDecl_Template_string_TypeDeclPtr: .. das:function:: replaceTypeWithTypeDecl(self: Template; name: string; expr: TypeDeclPtr) Adds a rule to the template to replace a type alias with another type alias, specified by type declaration. :Arguments: * **self** : :ref:`Template ` * **name** : string * **expr** : :ref:`TypeDeclPtr ` .. _function-templates_boost_replaceVarTag_Template_string_Expression_q_: .. das:function:: replaceVarTag(self: Template; name: string; expr: Expression?) Adds a rule to the template to replace a variable tag with an expression. :Arguments: * **self** : :ref:`Template ` * **name** : string * **expr** : :ref:`Expression `? .. _function-templates_boost_replaceVariable_Template_string_Expression_q_: .. das:function:: replaceVariable(self: Template; name: string; expr: Expression?) Adds a rule to the template to replace a variable with an expression. :Arguments: * **self** : :ref:`Template ` * **name** : string * **expr** : :ref:`Expression `? replaceVariableWithList ^^^^^^^^^^^^^^^^^^^^^^^ .. _function-templates_boost_replaceVariableWithList_Template_string_dasvector_rq_ptr_rq_Expression: .. das:function:: replaceVariableWithList(self: Template; name: string; expr: dasvector`ptr`Expression) Adds a rule to the template to replace a variable with an expression list. :Arguments: * **self** : :ref:`Template ` * **name** : string * **expr** : vector .. _function-templates_boost_replaceVariableWithList_Template_string_array_ls_Expression_q__gr_: .. das:function:: replaceVariableWithList(self: Template; name: string; expr: array) ++++++++++++++++++++ Template application ++++++++++++++++++++ * :ref:`apply_template (var rules: Template; at: LineInfo; var typ: TypeDecl?; forceAt: bool = true) : TypeDeclPtr ` * :ref:`apply_template (var rules: Template; at: LineInfo; var expr: Expression?; forceAt: bool = true) : Expression? ` * :ref:`apply_template (at: LineInfo; var expr: Expression?&; blk: block\<(var rules:Template):void\>) : Expression? ` * :ref:`apply_template (at: LineInfo; var typ: TypeDecl?&; blk: block\<(var rules:Template):void\>) : TypeDeclPtr ` * :ref:`apply_template (var expr: Expression?&; blk: block\<(var rules:Template):void\>) : Expression? ` apply_template ^^^^^^^^^^^^^^ .. _function-templates_boost_apply_template_Template_LineInfo_TypeDecl_q__bool: .. das:function:: apply_template(rules: Template; at: LineInfo; typ: TypeDecl?; forceAt: bool = true) : TypeDeclPtr Applies the template to the given expression. If `forceAt` is set, the resulting expression will have the same line info as 'at'. :Arguments: * **rules** : :ref:`Template ` * **at** : :ref:`LineInfo ` * **typ** : :ref:`TypeDecl `? * **forceAt** : bool .. _function-templates_boost_apply_template_Template_LineInfo_Expression_q__bool: .. das:function:: apply_template(rules: Template; at: LineInfo; expr: Expression?; forceAt: bool = true) : Expression? .. _function-templates_boost_apply_template_LineInfo_Expression_q__ref__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_template(at: LineInfo; expr: Expression?&; blk: block<(var rules:Template):void>) : Expression? .. _function-templates_boost_apply_template_LineInfo_TypeDecl_q__ref__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_template(at: LineInfo; typ: TypeDecl?&; blk: block<(var rules:Template):void>) : TypeDeclPtr .. _function-templates_boost_apply_template_Expression_q__ref__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_template(expr: Expression?&; blk: block<(var rules:Template):void>) : Expression? ++++++++++++++++++ Expression helpers ++++++++++++++++++ * :ref:`expression_at (var expr: Expression?; at: LineInfo) : Expression? ` * :ref:`remove_deref (varname: string; var expr: Expression?) ` * :ref:`visit_expression (var expr: Expression?&; var adapter: VisitorAdapter?) ` .. _function-templates_boost_expression_at_Expression_q__LineInfo: .. das:function:: expression_at(expr: Expression?; at: LineInfo) : Expression? Force expression location, then return it. :Arguments: * **expr** : :ref:`Expression `? * **at** : :ref:`LineInfo ` .. _function-templates_boost_remove_deref_string_Expression_q_: .. das:function:: remove_deref(varname: string; expr: Expression?) Removes dereferences of the variable `varname` from the expression. This is typically used when replacing 'workhorse' variable with constant. :Arguments: * **varname** : string * **expr** : :ref:`Expression `? .. _function-templates_boost_visit_expression_Expression_q__ref__VisitorAdapter_q_: .. das:function:: visit_expression(expr: Expression?&; adapter: VisitorAdapter?) Visits the expression with the given visitor adapter. :Arguments: * **expr** : :ref:`Expression `?\ & * **adapter** : :ref:`VisitorAdapter `? +++++++++++++++++++++ Expression generation +++++++++++++++++++++ * :ref:`make_expression_block (var exprs: dasvector`ptr`Expression) : ExprBlock? ` * :ref:`make_expression_block (var exprs: array\) : ExprBlock? ` make_expression_block ^^^^^^^^^^^^^^^^^^^^^ .. _function-templates_boost_make_expression_block_dasvector_rq_ptr_rq_Expression: .. das:function:: make_expression_block(exprs: dasvector`ptr`Expression) : ExprBlock? Create ExprBlock and move all expressions from expr to the list of the block. :Arguments: * **exprs** : vector .. _function-templates_boost_make_expression_block_array_ls_Expression_q__gr_: .. das:function:: make_expression_block(exprs: array) : ExprBlock? +++++++++++++ Block helpers +++++++++++++ * :ref:`move_unquote_block (var expr: Expression?&) : ExprBlock? ` * :ref:`unquote_block (expr: Expression?) : ExprBlock? ` .. _function-templates_boost_move_unquote_block_Expression_q__ref_: .. das:function:: move_unquote_block(expr: Expression?&) : ExprBlock? Moves the corresponding block subexpression expression from the ExprMakeBlock. :Arguments: * **expr** : :ref:`Expression `?\ & .. _function-templates_boost_unquote_block_Expression_q_: .. das:function:: unquote_block(expr: Expression?) : ExprBlock? Returns the corresponding block subexpression expression from the ExprMakeBlock. :Arguments: * **expr** : :ref:`Expression `? +++++++++++++++++++++++ Global variable helpers +++++++++++++++++++++++ * :ref:`add_global_let (mod: Module?; vname: string; vat: LineInfo; var value: Expression?) : bool ` * :ref:`add_global_private_let (mod: Module?; vname: string; vat: LineInfo; var value: Expression?) : bool ` * :ref:`add_global_private_var (mod: Module?; vname: string; vat: LineInfo; var value: Expression?) : bool ` * :ref:`add_global_var (mod: Module?; vname: string; var typ: TypeDeclPtr; vat: LineInfo; priv: bool; blk: block\<(var v:VariablePtr):void\>) : bool ` * :ref:`add_global_var (mod: Module?; vname: string; vat: LineInfo; var value: Expression?) : bool ` * :ref:`add_global_var (mod: Module?; vname: string; var typ: TypeDeclPtr; vat: LineInfo; priv: bool) : bool ` .. _function-templates_boost_add_global_let_Module_q__string_LineInfo_Expression_q_: .. das:function:: add_global_let(mod: Module?; vname: string; vat: LineInfo; value: Expression?) : bool Add global variable to the module, given name and initial value. Variable type will be constant. :Arguments: * **mod** : :ref:`Module `? * **vname** : string * **vat** : :ref:`LineInfo ` * **value** : :ref:`Expression `? .. _function-templates_boost_add_global_private_let_Module_q__string_LineInfo_Expression_q_: .. das:function:: add_global_private_let(mod: Module?; vname: string; vat: LineInfo; value: Expression?) : bool Add global variable to the module, given name and initial value. It will be private, and type will be constant. :Arguments: * **mod** : :ref:`Module `? * **vname** : string * **vat** : :ref:`LineInfo ` * **value** : :ref:`Expression `? .. _function-templates_boost_add_global_private_var_Module_q__string_LineInfo_Expression_q_: .. das:function:: add_global_private_var(mod: Module?; vname: string; vat: LineInfo; value: Expression?) : bool Add global variable to the module, given name and initial value. It will be private. :Arguments: * **mod** : :ref:`Module `? * **vname** : string * **vat** : :ref:`LineInfo ` * **value** : :ref:`Expression `? add_global_var ^^^^^^^^^^^^^^ .. _function-templates_boost_add_global_var_Module_q__string_TypeDeclPtr_LineInfo_bool_block_ls_var_v_c_VariablePtr_c_void_gr_: .. das:function:: add_global_var(mod: Module?; vname: string; typ: TypeDeclPtr; vat: LineInfo; priv: bool; blk: block<(var v:VariablePtr):void>) : bool Add global variable to the module, given name and type. `priv` specifies if the variable is private to the block. :Arguments: * **mod** : :ref:`Module `? * **vname** : string * **typ** : :ref:`TypeDeclPtr ` * **vat** : :ref:`LineInfo ` * **priv** : bool * **blk** : block<(v: :ref:`VariablePtr `):void> .. _function-templates_boost_add_global_var_Module_q__string_LineInfo_Expression_q_: .. das:function:: add_global_var(mod: Module?; vname: string; vat: LineInfo; value: Expression?) : bool .. _function-templates_boost_add_global_var_Module_q__string_TypeDeclPtr_LineInfo_bool: .. das:function:: add_global_var(mod: Module?; vname: string; typ: TypeDeclPtr; vat: LineInfo; priv: bool) : bool ++++++++++++++ Hygienic names ++++++++++++++ * :ref:`make_unique_private_name (prefix: string; vat: LineInfo) : string ` .. _function-templates_boost_make_unique_private_name_string_LineInfo: .. das:function:: make_unique_private_name(prefix: string; vat: LineInfo) : string Generates unique private name for the variable, given prefix and line info. .. warning:: The assumption is that line info is unique for the context of the unique name generation. If it is not, additional measures must be taken to ensure uniqueness of prefix. :Arguments: * **prefix** : string * **vat** : :ref:`LineInfo ` ++++++++++++++ Quoting macros ++++++++++++++ * :ref:`apply_qblock (var expr: Expression?; blk: block\<(var rules:Template):void\>) : Expression? ` * :ref:`apply_qblock_expr (var expr: Expression?; blk: block\<(var rules:Template):void\>) : Expression? ` * :ref:`apply_qblock_to_array (var expr: Expression?; blk: block\<(var rules:Template):void\>) : array\ ` * :ref:`apply_qmacro (var expr: Expression?; blk: block\<(var rules:Template):void\>) : Expression? ` * :ref:`apply_qmacro_function (fname: string; var expr: Expression?; blk: block\<(var rules:Template):void\>) : FunctionPtr ` * :ref:`apply_qmacro_method (fname: string; var parent: StructurePtr; var expr: Expression?; blk: block\<(var rules:Template):void\>) : FunctionPtr ` * :ref:`apply_qmacro_template_class (instance_name: string; var template_type: TypeDecl?; blk: block\<(var rules:Template):void\>) : TypeDeclPtr ` * :ref:`apply_qmacro_template_function (func: FunctionPtr; blk: block\<(var rules:Template):void\>) : FunctionPtr ` * :ref:`apply_qmacro_variable (vname: string; var expr: Expression?; blk: block\<(var rules:Template):void\>) : VariablePtr ` * :ref:`apply_qtype (var expr: Expression?; blk: block\<(var rules:Template):void\>) : TypeDeclPtr ` .. _function-templates_boost_apply_qblock_Expression_q__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qblock(expr: Expression?; blk: block<(var rules:Template):void>) : Expression? Implementation details for the expression reification. This is a block reification. :Arguments: * **expr** : :ref:`Expression `? * **blk** : block<(rules: :ref:`Template `):void> .. _function-templates_boost_apply_qblock_expr_Expression_q__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qblock_expr(expr: Expression?; blk: block<(var rules:Template):void>) : Expression? Implementation details for the expression reification. This is a first line of the block as expression reification. :Arguments: * **expr** : :ref:`Expression `? * **blk** : block<(rules: :ref:`Template `):void> .. _function-templates_boost_apply_qblock_to_array_Expression_q__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qblock_to_array(expr: Expression?; blk: block<(var rules:Template):void>) : array Implementation details for the expression reification. This is a block reification. :Arguments: * **expr** : :ref:`Expression `? * **blk** : block<(rules: :ref:`Template `):void> .. _function-templates_boost_apply_qmacro_Expression_q__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qmacro(expr: Expression?; blk: block<(var rules:Template):void>) : Expression? Implementation details for the expression reification. :Arguments: * **expr** : :ref:`Expression `? * **blk** : block<(rules: :ref:`Template `):void> .. _function-templates_boost_apply_qmacro_function_string_Expression_q__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qmacro_function(fname: string; expr: Expression?; blk: block<(var rules:Template):void>) : FunctionPtr Implementation details for reification. This is a function generation reification. :Arguments: * **fname** : string * **expr** : :ref:`Expression `? * **blk** : block<(rules: :ref:`Template `):void> .. _function-templates_boost_apply_qmacro_method_string_StructurePtr_Expression_q__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qmacro_method(fname: string; parent: StructurePtr; expr: Expression?; blk: block<(var rules:Template):void>) : FunctionPtr Implementation details for reification. This is a class method function generation reification. :Arguments: * **fname** : string * **parent** : :ref:`StructurePtr ` * **expr** : :ref:`Expression `? * **blk** : block<(rules: :ref:`Template `):void> .. _function-templates_boost_apply_qmacro_template_class_string_TypeDecl_q__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qmacro_template_class(instance_name: string; template_type: TypeDecl?; blk: block<(var rules:Template):void>) : TypeDeclPtr Implementation details for the expression reification. This is a template class instantiation reification. :Arguments: * **instance_name** : string * **template_type** : :ref:`TypeDecl `? * **blk** : block<(rules: :ref:`Template `):void> .. _function-templates_boost_apply_qmacro_template_function_FunctionPtr_block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qmacro_template_function(func: FunctionPtr; blk: block<(var rules:Template):void>) : FunctionPtr Applies template rules to a function, cloning it with substituted types. :Arguments: * **func** : :ref:`FunctionPtr ` * **blk** : block<(rules: :ref:`Template `):void> .. _function-templates_boost_apply_qmacro_variable_string_Expression_q__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qmacro_variable(vname: string; expr: Expression?; blk: block<(var rules:Template):void>) : VariablePtr Implementation details for reification. This is a variable generation reification. :Arguments: * **vname** : string * **expr** : :ref:`Expression `? * **blk** : block<(rules: :ref:`Template `):void> .. _function-templates_boost_apply_qtype_Expression_q__block_ls_var_rules_c_Template_c_void_gr_: .. das:function:: apply_qtype(expr: Expression?; blk: block<(var rules:Template):void>) : TypeDeclPtr Implementation details for the expression reification. This is a type declaration reification. :Arguments: * **expr** : :ref:`Expression `? * **blk** : block<(rules: :ref:`Template `):void> ++++++++++++++++++++ Type pointer helpers ++++++++++++++++++++ * :ref:`add_array_ptr_ref (var a: array\\>) : array\\> ` * :ref:`add_type_ptr_ref (var st: Structure?; flags: TypeDeclFlags) : TypeDeclPtr ` * :ref:`add_type_ptr_ref (a: TypeDeclPtr; flags: TypeDeclFlags) : TypeDeclPtr ` * :ref:`add_type_ptr_ref (var st: Enumeration?; flags: TypeDeclFlags) : TypeDeclPtr ` * :ref:`add_type_ptr_ref (anything: auto(TT); flags: TypeDeclFlags) : TypeDeclPtr ` .. _function-templates_boost_add_array_ptr_ref_array_ls_smart_ptr_ls_autoTT_gr__gr_: .. das:function:: add_array_ptr_ref(a: array>) : array> Implementation details for the reification. This adds any array to the rules. :Arguments: * **a** : array> add_type_ptr_ref ^^^^^^^^^^^^^^^^ .. _function-templates_boost_add_type_ptr_ref_Structure_q__TypeDeclFlags: .. das:function:: add_type_ptr_ref(st: Structure?; flags: TypeDeclFlags) : TypeDeclPtr Implementation details for the reification. Creates a type declaration from a structure pointer. :Arguments: * **st** : :ref:`Structure `? * **flags** : :ref:`TypeDeclFlags ` .. _function-templates_boost_add_type_ptr_ref_TypeDeclPtr_TypeDeclFlags: .. das:function:: add_type_ptr_ref(a: TypeDeclPtr; flags: TypeDeclFlags) : TypeDeclPtr .. _function-templates_boost_add_type_ptr_ref_Enumeration_q__TypeDeclFlags: .. das:function:: add_type_ptr_ref(st: Enumeration?; flags: TypeDeclFlags) : TypeDeclPtr .. _function-templates_boost_add_type_ptr_ref_autoTT_TypeDeclFlags_0x290: .. das:function:: add_type_ptr_ref(anything: auto(TT); flags: TypeDeclFlags) : TypeDeclPtr +++++++++++++++++ Structure helpers +++++++++++++++++ * :ref:`add_structure_field (var cls: StructurePtr; name: string; var t: TypeDeclPtr; var init: Expression?) : int ` .. _function-templates_boost_add_structure_field_StructurePtr_string_TypeDeclPtr_Expression_q_: .. das:function:: add_structure_field(cls: StructurePtr; name: string; t: TypeDeclPtr; init: Expression?) : int Adds a field to the structure. :Arguments: * **cls** : :ref:`StructurePtr ` * **name** : string * **t** : :ref:`TypeDeclPtr ` * **init** : :ref:`Expression `? ++++++++++++++++ Class generation ++++++++++++++++ * :ref:`enum_class_type (st: auto) : auto ` * :ref:`make_class (name: string; var baseClass: Structure?; mod: Module?) : Structure? ` * :ref:`make_class (name: string; mod: Module?) : Structure? ` * :ref:`make_class_constructor (cls: StructurePtr; ctor: FunctionPtr) : Function? ` * :ref:`modify_to_class_member (cls: StructurePtr; fun: FunctionPtr; isExplicit: bool; Constant: bool) ` .. _function-templates_boost_enum_class_type_auto_0x278: .. das:function:: enum_class_type(st: auto) : auto return underlying type for the enumeration :Arguments: * **st** : auto make_class ^^^^^^^^^^ .. _function-templates_boost_make_class_string_Structure_q__Module_q_: .. das:function:: make_class(name: string; baseClass: Structure?; mod: Module?) : Structure? Creates a class structure derived from baseClass. Adds __rtti, __finalize fields. :Arguments: * **name** : string * **baseClass** : :ref:`Structure `? * **mod** : :ref:`Module `? .. _function-templates_boost_make_class_string_Module_q_: .. das:function:: make_class(name: string; mod: Module?) : Structure? ---- .. _function-templates_boost_make_class_constructor_StructurePtr_FunctionPtr: .. das:function:: make_class_constructor(cls: StructurePtr; ctor: FunctionPtr) : Function? Adds a class constructor from a constructor function. :Arguments: * **cls** : :ref:`StructurePtr ` * **ctor** : :ref:`FunctionPtr ` .. _function-templates_boost_modify_to_class_member_StructurePtr_FunctionPtr_bool_bool: .. das:function:: modify_to_class_member(cls: StructurePtr; fun: FunctionPtr; isExplicit: bool; Constant: bool) Modifies function to be a member of a particular class. :Arguments: * **cls** : :ref:`StructurePtr ` * **fun** : :ref:`FunctionPtr ` * **isExplicit** : bool * **Constant** : bool