model_server/dd/src/ddict.h.cxx
// given a dd node for a class, return a list (objArr)
// of the its member functions
given a dd node for a class, return a list (objArr)
of the its member functions
given a dd node for a class return a list ( objArr ) of the its member functions
void ddElement::func_members_of_class(objArr& ddArr) {
	Initialize(ddElement::func_members_of_class);
	smtTree* smt = checked_cast(smtTree, get_relation(def_smt_of_dd, this));
	smtTree* p = smt;
	if (!p || p->get_node_type() != SMT_cdecl) {
		return;
	}
	p = checked_cast(smtTree, p->get_first());
	if (!p || (p->get_node_type() != SMT_title && p->get_node_type() !=
		   SMT_superclass)) {
		return;
	}
	p = checked_cast(smtTree, p->get_next());
	if (!p || p->get_node_type() != SMT_cbody) {
		return;
	}
	p = checked_cast(smtTree, p->get_first());
	while (p) {
		smtTreePtr q;
		q = p;	
		int nt = q->get_node_type();
		if (nt == SMT_list_decl) {
			q = checked_cast(smtTree, q->get_first());
			while (q) {
			  	if (q->get_node_type() == SMT_fdecl) {
					smtTreePtr   s;  
					ddElementPtr dd; 
					s  = checked_cast(smtTree, get_relation(id_of_decl, q));
					if (s) {
						dd = checked_cast(ddElement,
							get_relation(ref_dd_of_smt, s));
						if (dd) {
							ddArr.insert_last(dd); 
						}
					}
				}
				q = checked_cast(smtTree, q->get_next());
			}
		}	
		q = p;
		if (nt == SMT_fdef) {
		  ddElement* dd = checked_cast(ddElement, get_relation(def_dd_of_smt,p));
		  if (dd)
		    ddArr.insert_last(dd);	
		}
		if (nt == SMT_fdecl) {
			smtTreePtr   s;		
			ddElementPtr dd;	
			s  = checked_cast(smtTree, get_relation(id_of_decl, q));
			if (s) {
				dd = checked_cast(ddElement, get_relation(ref_dd_of_smt, s));
				if (dd) {
					ddArr.insert_last(dd);	
				}
			}
		}
		p = checked_cast(smtTree, p->get_next());
	}
}
void ddElement :: func_members_of_class ( objArr & ddArr ) { Initialize ( ddElement :: func_members_of_class ) ; smtTree * smt = checked_cast ( smtTree , get_relation ( def_smt_of_dd , this ) ) ; smtTree * p = smt ; if ( ! p || p -> get_node_type ( ) != SMT_cdecl ) { return ; } p = checked_cast ( smtTree , p -> get_first ( ) ) ; if ( ! p || ( p -> get_node_type ( ) != SMT_title && p -> get_node_type ( ) != SMT_superclass ) ) { return ; } p = checked_cast ( smtTree , p -> get_next ( ) ) ; if ( ! p || p -> get_node_type ( ) != SMT_cbody ) { return ; } p = checked_cast ( smtTree , p -> get_first ( ) ) ; while ( p ) { smtTreePtr q ; q = p ; int nt = q -> get_node_type ( ) ; if ( nt == SMT_list_decl ) { q = checked_cast ( smtTree , q -> get_first ( ) ) ; while ( q ) { if ( q -> get_node_type ( ) == SMT_fdecl ) { smtTreePtr s ; ddElementPtr dd ; s = checked_cast ( smtTree , get_relation ( id_of_decl , q ) ) ; if ( s ) { dd = checked_cast ( ddElement , get_relation ( ref_dd_of_smt , s ) ) ; if ( dd ) { ddArr . insert_last ( dd ) ; } } } q = checked_cast ( smtTree , q -> get_next ( ) ) ; } } q = p ; if ( nt == SMT_fdef ) { ddElement * dd = checked_cast ( ddElement , get_relation ( def_dd_of_smt , p ) ) ; if ( dd ) ddArr . insert_last ( dd ) ; } if ( nt == SMT_fdecl ) { smtTreePtr s ; ddElementPtr dd ; s = checked_cast ( smtTree , get_relation ( id_of_decl , q ) ) ; if ( s ) { dd = checked_cast ( ddElement , get_relation ( ref_dd_of_smt , s ) ) ; if ( dd ) { ddArr . insert_last ( dd ) ; } } } p = checked_cast ( smtTree , p -> get_next ( ) ) ; } }
given a dd node for a class, return a list (objArr)
of the its member functions
given a dd node for a class return a list ( objArr ) of the its member functions
// find the smt class declaration corresponding to // the input dd class entry // must not lose p if we walk around // token for name of function // dd element for the token // put on list // put on list // token for name of function // dd element for the token // put on list