Skip to content

Commit

Permalink
Merge branch 'cds_instancedump_4' into cds_instancedump_keith_4
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbrown committed Feb 26, 2013
2 parents 5ac0c3e + b294d9f commit e1ffa2d
Show file tree
Hide file tree
Showing 23 changed files with 3,451 additions and 3,482 deletions.
54 changes: 24 additions & 30 deletions arc/frag_util.arc
Original file line number Diff line number Diff line change
Expand Up @@ -80,37 +80,34 @@ ${indent.result}}
.param inst_ref te_class
.param string instance
.//
.assign result = FALSE
.assign result = false
.select any te_instance from instances of TE_INSTANCE
.select any te_string from instances of TE_STRING
.select any te_attr related by te_class->TE_ATTR[R2061] where ( selected.prevID == 0 )
.while ( not_empty te_attr )
.select one o_attr related by te_attr->O_ATTR[R2033]
.if ( te_attr.translate )
.invoke member_type = GetAttributeCodeGenType( o_attr )
.assign cdt = member_type.cdt
.if ( not_empty cdt )
.if ( cdt.Core_Typ == 5 )
.assign dt = member_type.dt
.// Core_Typ == 5 is "unique_id"
.// CDS: Note "select any" when there may be more than one.
.select any o_oida related by o_attr->O_OIDA[R105]
.if ( not_empty o_oida )
.select one te_dt related by dt->TE_DT[R2021]
.assign result = TRUE
.invoke r = GetAttributeCodeGenType( o_attr )
.assign te_dt = r.result
.if ( not_empty te_dt )
.if ( 5 == te_dt.Core_Typ )
.// unique_id
.select any o_oida related by o_attr->O_OIDA[R105]
.if ( not_empty o_oida )
.assign result = true
${instance}->${te_attr.GeneratedName} = (${te_dt.ExtName}) ${instance};
.end if
.elif ( ( 2 == cdt.Core_Typ ) or ( 3 == cdt.Core_Typ ) )
.// integer or real
.if ( te_attr.DefaultValue != "" )
.end if
.elif ( ( 2 == te_dt.Core_Typ ) or ( 3 == te_dt.Core_Typ ) )
.// integer or real
.if ( "" != te_attr.DefaultValue )
${instance}->${te_attr.GeneratedName} = ${te_attr.DefaultValue}; /* DefaultValue */
.end if
.elif ( 4 == cdt.Core_Typ )
.// string
.if ( te_attr.DefaultValue != "" )
.end if
.elif ( 4 == te_dt.Core_Typ )
.// string
.if ( "" != te_attr.DefaultValue )
${te_instance.module}${te_string.strcpy}( ${instance}->${te_attr.GeneratedName}, ${te_attr.DefaultValue} ); /* DefaultValue */
.end if
.end if
.end if .// cdt.Core_Typ == 5 (unique_id)
.end if
.end if
.//
Expand All @@ -133,13 +130,10 @@ ${te_instance.module}${te_string.strcpy}( ${instance}->${te_attr.GeneratedName},
.assign cmp_element = ""
.select many te_attrs related by o_obj->O_ATTR[R102]->TE_ATTR[R2033] where ( selected.Included )
.for each te_attr in te_attrs
.select one obj_attr related by te_attr->O_ATTR[R2033]
.invoke data_type = GetAttributeCodeGenType( obj_attr )
.assign dt = data_type.dt
.if ( "string" != dt.Name )
.assign cmp_element = "${selected_var_name}->${te_attr.GeneratedName} == ${te_attr.ParamBuffer}"
.else
.if ( 4 == te_attr.Core_Typ )
.assign cmp_element = "!${te_instance.module}${te_string.strcmp}(${selected_var_name}->${te_attr.GeneratedName}, ${te_attr.ParamBuffer})"
.else
.assign cmp_element = "${selected_var_name}->${te_attr.GeneratedName} == ${te_attr.ParamBuffer}"
.end if
.assign compare_stmt = compare_stmt + cmp_element
.if ( not_last te_attrs )
Expand All @@ -159,14 +153,14 @@ ${compare_stmt}\
.assign num_ident_attr = cardinality o_attrs
.//
.assign param_list = ""
.assign ident_attr_count = 0
.assign oida_count = 0
.//
.select any te_attr related by o_obj->TE_CLASS[R2019]->TE_ATTR[R2061] where ( selected.prevID == 0 )
.while ( not_empty te_attr )
.if ( te_attr.Included )
.assign ident_attr_count = ident_attr_count + 1
.assign oida_count = oida_count + 1
.assign param_list = param_list + te_attr.ParamBuffer
.if ( ident_attr_count < num_ident_attr )
.if ( oida_count < num_ident_attr )
.assign param_list = param_list + ", "
.end if
.end if
Expand Down
Empty file modified arc/m.component.arc
100755 → 100644
Empty file.
12 changes: 6 additions & 6 deletions arc/q.class.arc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ${te_target.c2cplusplus_linkage_end}
.assign comment = ""
.select any te_sys from instances of TE_SYS
.if ( not te_sys.InstanceLoading )
.invoke note = GetObjectAttributeInfoComment( o_attr, TRUE )
.invoke note = GetObjectAttributeInfoComment( o_attr, true )
.if ( note.result != "" )
.assign comment = "/* ${note.result} */"
.end if
Expand Down Expand Up @@ -115,13 +115,13 @@ ${te_target.c2cplusplus_linkage_end}
.//
.// Input Parameters:
.// <obj_attr> Instance reference to O_ATTR.
.// <do_naming_attr_also> Boolean. If FALSE, comment generated for indentifying
.// and referential attributes only. If TRUE, comment generated for
.// <do_naming_attribs_also> Boolean. If false, comment generated for indentifying
.// and referential attributes only. If true, comment generated for
.// naming attributes.
.//============================================================================
.function GetObjectAttributeInfoComment
.param inst_ref o_attr
.param boolean do_naming_attr_also
.param boolean do_naming_attribs_also
.//
.assign result = ""
.//
Expand Down Expand Up @@ -168,7 +168,7 @@ ${te_target.c2cplusplus_linkage_end}
.end for .// obj_ref in obj_ref_set
.end if .// not_empty ref_attr
.//
.if ( (result == "") and do_naming_attr_also )
.if ( (result == "") and do_naming_attribs_also )
.assign result = "- ${o_attr.Name}"
.select one dbattr related by o_attr->O_BATTR[R106]->O_DBATTR[R107]
.if ( not_empty dbattr )
Expand Down Expand Up @@ -440,7 +440,7 @@ ${file_epilogue.body}
.select one te_aba related by te_tfr->TE_ABA[R2010]
.select one o_tfr related by te_tfr->O_TFR[R2024]
.select one rval_te_dt related by o_tfr->S_DT[R116]->TE_DT[R2021]
.assign rval_te_dt.Included = TRUE
.assign rval_te_dt.Included = true
.assign prelude = "class"
.assign instance_based_self_declaration = ""
.if ( o_tfr.Instance_Based == 1 )
Expand Down
33 changes: 16 additions & 17 deletions arc/q.class.factory.arc
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,23 @@ ${te_class.GeneratedName}_instanceloader( ${te_instance.handle} instance, const
.select one o_attr related by te_attr->O_ATTR[R2033]
.assign persistent = ( "$l{o_attr.Descrip:Persistent}" != "false" )
.if ( te_attr.translate and persistent )
.invoke member_type = GetAttributeCodeGenType( o_attr )
.assign cdt = member_type.cdt
.assign dt = member_type.dt
.if ( empty cdt )
.invoke r = GetAttributeCodeGenType( o_attr )
.assign te_dt = r.result
.if ( te_dt.Core_Typ < 0 )
.// sdt
.elif ( cdt.Core_Typ == 0 )
.elif ( 0 == te_dt.Core_Typ )
.// void
.elif ( cdt.Core_Typ == 1 )
.elif ( 1 == te_dt.Core_Typ )
.// boolean
${te_instance.self}->${te_attr.GeneratedName} = ( '0' != *avlstring[ ${attribute_number} ] );
.assign attribute_number = attribute_number + 1
.elif ( cdt.Core_Typ == 2 )
.elif ( 2 == te_dt.Core_Typ )
.// integer
${te_instance.self}->${te_attr.GeneratedName} = ${te_instance.module}${te_string.atoi}( avlstring[ ${attribute_number} ] );
.assign attribute_number = attribute_number + 1
.elif ( cdt.Core_Typ == 3 )
.elif ( 3 == te_dt.Core_Typ )
.// real
.elif ( cdt.Core_Typ == 4 )
.elif ( 4 == te_dt.Core_Typ )
.// string
.if ( "Action_Semantics_internal" == te_attr.Name )
${te_instance.self}->${te_attr.GeneratedName} = (c_t *) ${te_dma.allocate}( avlstring[ ${attribute_number} + 1 ] - avlstring[ ${attribute_number} ] );
Expand All @@ -119,7 +118,7 @@ ${te_class.GeneratedName}_instanceloader( ${te_instance.handle} instance, const
${te_instance.module}${te_string.strcpy}( ${te_instance.self}->${te_attr.GeneratedName}, avlstring[ ${attribute_number} ] );
.end if
.assign attribute_number = attribute_number + 1
.elif ( cdt.Core_Typ == 5 )
.elif ( 5 == te_dt.Core_Typ )
.// unique_id
${te_instance.self}->${te_attr.GeneratedName} = (${te_instance.handle}) ${te_instance.module}${te_string.atoi}( avlstring[ ${attribute_number} ] );
.select any o_oida related by o_attr->O_OIDA[R105] where ( selected.Oid_ID == 0 )
Expand All @@ -128,27 +127,27 @@ ${te_class.GeneratedName}_instanceloader( ${te_instance.handle} instance, const
return_identifier = ${te_instance.self}->${te_attr.GeneratedName};
.end if
.assign attribute_number = attribute_number + 1
.elif ( cdt.Core_Typ == 6 )
.elif ( 6 == te_dt.Core_Typ )
.// current_state
.elif ( cdt.Core_Typ == 7 )
.elif ( 7 == te_dt.Core_Typ )
.// same as base<Attribute>
.elif ( cdt.Core_Typ == 8 )
.elif ( 8 == te_dt.Core_Typ )
.// inst_ref<Object>
${te_instance.self}->${te_attr.GeneratedName} = ${te_instance.module}${te_string.atoi}( avlstring[ ${attribute_number} ] );
.assign attribute_number = attribute_number + 1
.elif ( cdt.Core_Typ == 9 )
.elif ( 9 == te_dt.Core_Typ )
.// inst_ref_set<Object>
${te_instance.self}->${te_attr.GeneratedName} = ${te_instance.module}${te_string.atoi}( avlstring[ ${attribute_number} ] );
.assign attribute_number = attribute_number + 1
.elif ( cdt.Core_Typ == 10 )
.elif ( 10 == te_dt.Core_Typ )
.// inst<Event>
${te_instance.self}->${te_attr.GeneratedName} = ${te_instance.module}${te_string.atoi}( avlstring[ ${attribute_number} ] );
.assign attribute_number = attribute_number + 1
.elif ( cdt.Core_Typ == 11 )
.elif ( 11 == te_dt.Core_Typ )
.// inst<Mapping>
${te_instance.self}->${te_attr.GeneratedName} = ${te_instance.module}${te_string.atoi}( avlstring[ ${attribute_number} ] );
.assign attribute_number = attribute_number + 1
.elif ( cdt.Core_Typ == 12 )
.elif ( 12 == te_dt.Core_Typ )
.// inst_ref<Mapping>
${te_instance.self}->${te_attr.GeneratedName} = ${te_instance.module}${te_string.atoi}( avlstring[ ${attribute_number} ] );
.assign attribute_number = attribute_number + 1
Expand Down
Loading

0 comments on commit e1ffa2d

Please sign in to comment.