model_server/ui_viewer/src/enable_reparse_buttons.cxx
// Check if a particular view as represented by the ldr
// depends on the specified smt header.
Check if a particular view as represented by the ldr
depends on the specified smt header.
Check if a particular view as represented by the ldr depends on the specified smt header .
static bool view_contains(ldrPtr ldr_head, smtHeaderPtr smth)
{
    Initialize(view_contains);
    appPtr app_head = checked_cast(app, get_relation(app_of_ldr, ldr_head));
    if(app_head) {
	if(is_smtHeader(app_head)) {
	    return(smth == checked_cast(smtHeader, app_head));
	}
	if(is_symbolTreeHeader(app_head)) {
	    RTLNode *rtl_node = checked_cast (RTLNode, app_head->get_root ());
	    symbolArr &contents = rtl_node->rtl_contents();
	    int index, size = contents.size();
	    for(index = 0; index < size; ++index) {
		fsymbolPtr  xsym = contents[index].get_xrefSymbol();
		if(xsym.is_loaded()) {
		    ddElement *def_dd = xsym->get_def_dd();
		    if(def_dd) {
			appPtr app = def_dd->get_main_header();
			if(is_smtHeader(app) && (smtHeader *)app == smth)
			    return true;
		    }
		}
	    }
	}
    }
    return false;
}
static bool view_contains ( ldrPtr ldr_head , smtHeaderPtr smth ) { Initialize ( view_contains ) ; appPtr app_head = checked_cast ( app , get_relation ( app_of_ldr , ldr_head ) ) ; if ( app_head ) { if ( is_smtHeader ( app_head ) ) { return ( smth == checked_cast ( smtHeader , app_head ) ) ; } if ( is_symbolTreeHeader ( app_head ) ) { RTLNode * rtl_node = checked_cast ( RTLNode , app_head -> get_root ( ) ) ; symbolArr & contents = rtl_node -> rtl_contents ( ) ; int index , size = contents . size ( ) ; for ( index = 0 ; index < size ; ++ index ) { fsymbolPtr xsym = contents [ index ] . get_xrefSymbol ( ) ; if ( xsym . is_loaded ( ) ) { ddElement * def_dd = xsym -> get_def_dd ( ) ; if ( def_dd ) { appPtr app = def_dd -> get_main_header ( ) ; if ( is_smtHeader ( app ) && ( smtHeader * ) app == smth ) return true ; } } } } } return false ; }
Check if a particular view as represented by the ldr
depends on the specified smt header.
Check if a particular view as represented by the ldr depends on the specified smt header .