model_server/ldr/src/delete_node_views.cxx
// called from obj_unload()
// to find all erd, inheritance, etc. views, based on the given app
// and to delete these views to avoid "zomby" views
called from obj_unload()
to find all erd, inheritance, etc. views, based on the given app
and to delete these views to avoid "zomby" views
called from obj_unload () to find all erd inheritance etc . views based on the given app and to delete these views to avoid " zomby " views
void dd_delete_dd_or_xref_node_views(Obj* obj)
{
    Initialize(delete_dd_or_xref_node_views);
    Relational* h = (Relational*)obj;
    if (!is_app(h))
	return;
    if (is_smtHeader(h)) {
	smtHeader * smth = (smtHeader*)h;
	if (!smth->foreign && smth->srcbuf)
	    smth->cut_ast();
    }
    ddRoot* dr = checked_cast (ddRoot,get_relation(ddRoot_of_smtHeader, h));
    if (dr == 0)
	return;
    start_transaction() {
	objSet wmm_headers;
	for(objTree* t = dr->get_first(); t; t = t->get_next())
	    collect_dd_or_xref_node_headers(t, wmm_headers);
	int do_it = 1;
	while (do_it) {
	    do_it = 0;
	    Obj* el;
	    ForEach(el,wmm_headers) {
		do_it = 1;
		wmm_headers.remove(el);
		if (!is_ldrOODT(RelationalPtr(el))) {
		    obj_unload(el);
		}
		break;
	    }
	}
    } end_transaction();
}
void dd_delete_dd_or_xref_node_views ( Obj * obj ) { Initialize ( delete_dd_or_xref_node_views ) ; Relational * h = ( Relational * ) obj ; if ( ! is_app ( h ) ) return ; if ( is_smtHeader ( h ) ) { smtHeader * smth = ( smtHeader * ) h ; if ( ! smth -> foreign && smth -> srcbuf ) smth -> cut_ast ( ) ; } ddRoot * dr = checked_cast ( ddRoot , get_relation ( ddRoot_of_smtHeader , h ) ) ; if ( dr == 0 ) return ; start_transaction ( ) { objSet wmm_headers ; for ( objTree * t = dr -> get_first ( ) ; t ; t = t -> get_next ( ) ) collect_dd_or_xref_node_headers ( t , wmm_headers ) ; int do_it = 1 ; while ( do_it ) { do_it = 0 ; Obj * el ; ForEach ( el , wmm_headers ) { do_it = 1 ; wmm_headers . remove ( el ) ; if ( ! is_ldrOODT ( RelationalPtr ( el ) ) ) { obj_unload ( el ) ; } break ; } } } end_transaction ( ) ; }
called from obj_unload()
to find all erd, inheritance, etc.
called from obj_unload () to find all erd inheritance etc .