예제 #1
0
/*
 * Create an instance of the class numbered on the input.
 * Return the handle of the created instance.
 */
Escher_iHandle_t
Escher_CreateInstance(
    const Escher_DomainNumber_t domain_num,
    const Escher_ClassNumber_t class_num
)
{
    Escher_SetElement_s * node;
    Escher_iHandle_t instance;
    Escher_Extent_t * dci = *(domain_class_info[ domain_num ] + class_num);
    node = dci->inactive.head;

    if ( 0 == node ) {
        Escher_SetElement_s * container =
            ( Escher_SetElement_s *) Escher_malloc( 10 * sizeof( Escher_SetElement_s ) );
        Escher_iHandle_t pool = ( Escher_iHandle_t ) Escher_malloc( 10 * dci->size );
        if ( ( 0 == container ) || ( 0 == pool ) ) {
            UserObjectPoolEmptyCallout( domain_num, class_num );
        } else {
            Escher_memset( pool, 0, 10 * dci->size );
            dci->inactive.head = Escher_SetInsertBlock(
                                     container, (const u1_t *) pool, dci->size, 10 );
            node = dci->inactive.head;
        }
    }

    dci->inactive.head = dci->inactive.head->next;
    instance = (Escher_iHandle_t) node->object;
    instance->current_state = dci->initial_state;
    Escher_SetInsertInstance( &dci->active, node );
    return instance;
}
예제 #2
0
/*
 * UNRELATE TE_CLASS FROM TE_SWC ACROSS R2001
 */
void
ooaofooa_TE_SWC_R2001_Unlink( ooaofooa_TE_CLASS * part, ooaofooa_TE_SWC * form )
{
  /* Use TagEmptyHandleDetectionOn() to detect empty handle references.  */
  Escher_memset( &form->GeneratedName, 0, sizeof( form->GeneratedName ) );
  form->TE_CLASS_R2001 = 0;
  Escher_SetRemoveElement( &part->TE_SWC_R2001, (Escher_ObjectSet_s *) form );
}
/*
 * UNRELATE TE_CLASS FROM TE_SELECT_RELATED ACROSS R2077
 */
void
ooaofooa_TE_SELECT_RELATED_R2077_Unlink( ooaofooa_TE_CLASS * part, ooaofooa_TE_SELECT_RELATED * form )
{
  /* Use TagEmptyHandleDetectionOn() to detect empty handle references.  */
  Escher_memset( &form->te_classGeneratedName, 0, sizeof( form->te_classGeneratedName ) );
  form->TE_CLASS_R2077 = 0;
  part->TE_SELECT_RELATED_R2077 = 0;
}
예제 #4
0
/*
 * UNRELATE TE_CLASS FROM TE_LNK ACROSS R2076
 */
void
ooaofooa_TE_LNK_R2076_Unlink_connects( ooaofooa_TE_CLASS * part, ooaofooa_TE_LNK * form )
{
  /* Use TagEmptyHandleDetectionOn() to detect empty handle references.  */
  Escher_memset( &form->te_classGeneratedName, 0, sizeof( form->te_classGeneratedName ) );
  form->TE_CLASS_R2076_chains = 0;
  Escher_SetRemoveElement( &part->TE_LNK_R2076_connects, (Escher_ObjectSet_s *) form );
}
예제 #5
0
/*
 * Delete an instance of the class passed and numbered on the input.
 */
void
Escher_DeleteInstance(
  Escher_iHandle_t instance,
  const Escher_DomainNumber_t domain_num,
  const Escher_ClassNumber_t class_num
)
{
  Escher_SetElement_s * node;
  Escher_Extent_t * dci = *(domain_class_info[ domain_num ] + class_num);
  node = Escher_SetRemoveNode( &dci->active, instance );
  node->next = dci->inactive.head;
  dci->inactive.head = node;
  /* Initialize storage to zero.  */
  Escher_memset( instance, 0, dci->size );
}
예제 #6
0
파일: sys_xtuml.c 프로젝트: yakashi/mc
/*
 * Delete an instance of the class passed and numbered on the input.
 */
void
Escher_DeleteInstance(
    Escher_iHandle_t instance,
    const Escher_DomainNumber_t domain_num,
    const Escher_ClassNumber_t class_num
)
{
    Escher_SetElement_s * node;
    Escher_Extent_t * dci = *(domain_class_info[ domain_num ] + class_num);
    if ( 0 != instance ) {
        node = Escher_SetRemoveNode( &dci->active, instance );
        node->next = dci->inactive.head;
        dci->inactive.head = node;
        /* Initialize storage to zero.  */
        Escher_memset( instance, 0, dci->size );
        if ( ( 0 != dci->size ) && ( 0 != dci->initial_state ) ) {
            instance->current_state = -1; /* 0xff max for error detection */
        }
    }
}