model_server/dd/src/ddict.h.cxx
// given a dd element for a method (member function),
// return the class which declares the method
given a dd element for a method (member function),
return the class which declares the method
given a dd element for a method ( member function ) return the class which declares the method
ddElementPtr ddElement::method_get_class() {
	Initialize(ddElement::method_get_class);
	ddElementPtr p           = this;
	ddElementPtr using_class = NULL;
	if (p && p->get_kind() == DD_FUNC_DECL) {
		fsymbolPtr xMethod = p->get_xrefSymbol();
		if (xMethod.xrisnotnull()) {
			fsymbolPtr xClass = xMethod->get_parent_of();
			if (xClass.xrisnotnull()) {
				using_class = xClass->get_def_dd();
			}
		}
	}
	return using_class;
}
ddElementPtr ddElement :: method_get_class ( ) { Initialize ( ddElement :: method_get_class ) ; ddElementPtr p = this ; ddElementPtr using_class = NULL ; if ( p && p -> get_kind ( ) == DD_FUNC_DECL ) { fsymbolPtr xMethod = p -> get_xrefSymbol ( ) ; if ( xMethod . xrisnotnull ( ) ) { fsymbolPtr xClass = xMethod -> get_parent_of ( ) ; if ( xClass . xrisnotnull ( ) ) { using_class = xClass -> get_def_dd ( ) ; } } } return using_class ; }
given a dd element for a method (member function),
return the class which declares the method
given a dd element for a method ( member function ) return the class which declares the method
// the dd for a member function used to be // connected to its class via get_parent(), // but this connection is no longer made. // one way to get to the declaring class' dd // element is through the xref.