void * vhash_lookup( vhash_t * v, void * in_key) { void * item = 0; vhash_lookup_item(v, in_key, &item); return item; }
EE_LIST* HSolidModel::GetEEListForComponent(component_handle* comp_handle) { EE_LIST* ret_eelist = 0; if( !mhash_CompHandle_2_EEList ) mhash_CompHandle_2_EEList = new_vhash(512, malloc, free); if( VHASH_STATUS_SUCCESS != vhash_lookup_item(mhash_CompHandle_2_EEList, comp_handle, (void**) &ret_eelist) ) { // create a EE_LIST of ASM_MODEL_REFs outcome o; asm_model* root_model = 0; entity_handle_list model_refs; o = asmi_component_get_root_model(comp_handle, root_model); o = asmi_component_get_path(comp_handle, root_model, model_refs); // #ifdef DEBUG_NEW // #undef new DEBUG_NEW ret_eelist = ACIS_NEW EE_LIST(); // #define new DEBUG_NEW // #endif ret_eelist->set_ownership(false); ret_eelist->init(); model_refs.init(); for (entity_handle* ent_handle = model_refs.first(); ent_handle != NULL; ent_handle = model_refs.next()) { ENTITY* ent = ent_handle->entity_ptr(); ret_eelist->add(ent); } vhash_insert_item(mhash_CompHandle_2_EEList, (void*) comp_handle, (void*)ret_eelist); } return ret_eelist; }