model_server/subsystem/src/Entity.cxx
//------------------------------------------
// Entity::find_member_dtors: if this Entity is a destructor, examines
// all sibling members for destructors that will be implicitly invoked by
// this destructor and adds any such member destructors to the argument
// symbolArr.  THIS IS A CROCK AND A KLUDGE AND SHOULD BE REMOVED AS SOON
// AS THE MODEL HAS THESE RELATIONSHIPS IN IT.
//------------------------------------------
:find_member_dtors: if this Entity is a destructor, examines
all sibling members for destructors that will be implicitly invoked by
this destructor and adds any such member destructors to the argument
symbolArr.
: find_member_dtors : if this Entity is a destructor examines all sibling members for destructors that will be implicitly invoked by this destructor and adds any such member destructors to the argument symbolArr .
void Entity::find_member_dtors(symbolArr& dtors) {
   Initialize(Entity::find_member_dtors);
   if (strstr(my_sym.get_name(), "::~")) {
      symbolArr users;
      symbolPtr my_class = my_sym.get_parent_of(projects_to_search);
      if (my_class.xrisnotnull()) {
	 symbolArr siblings;
	 my_class.get_link(is_using, siblings, projects_to_search);
	 symbolPtr sibling;
	 ForEachS(sibling, siblings) {
	    if (sibling.get_kind() == DD_FIELD) {
	       symbolArr sib_classes;
	       symbolArr types;
	       if (sibling.get_link(has_type, types, projects_to_search)) {
		  if (collect_classes_from_type(types[0], sib_classes,
						projects_to_search)) {
		     symbolPtr sib_class;
		     ForEachS(sib_class, sib_classes) {
			symbolArr members;
			sib_class.get_link(is_using, members,
					    projects_to_search);
			symbolPtr member;
			ForEachS(member, members) {
			   if (member.get_kind() == DD_FUNC_DECL &&
			       strstr(member.get_name(), "::~")) {
			      member.get_base_dtors(dtors);	
			      break;
			   }
			}
		     }
		  }
	       }
	    }
	 }
      }
   }
}
void Entity :: find_member_dtors ( symbolArr & dtors ) { Initialize ( Entity :: find_member_dtors ) ; if ( strstr ( my_sym . get_name ( ) , " " ) ) { symbolArr users ; symbolPtr my_class = my_sym . get_parent_of ( projects_to_search ) ; if ( my_class . xrisnotnull ( ) ) { symbolArr siblings ; my_class . get_link ( is_using , siblings , projects_to_search ) ; symbolPtr sibling ; ForEachS ( sibling , siblings ) { if ( sibling . get_kind ( ) == DD_FIELD ) { symbolArr sib_classes ; symbolArr types ; if ( sibling . get_link ( has_type , types , projects_to_search ) ) { if ( collect_classes_from_type ( types [ 0 ] , sib_classes , projects_to_search ) ) { symbolPtr sib_class ; ForEachS ( sib_class , sib_classes ) { symbolArr members ; sib_class . get_link ( is_using , members , projects_to_search ) ; symbolPtr member ; ForEachS ( member , members ) { if ( member . get_kind ( ) == DD_FUNC_DECL && strstr ( member . get_name ( ) , " " ) ) { member . get_base_dtors ( dtors ) ; break ; } } } } } } } } } }
Entity::find_member_dtors: if this Entity is a destructor, examines
all sibling members for destructors that will be implicitly invoked by
this destructor and adds any such member destructors to the argument
symbolArr.
Entity :: find_member_dtors : if this Entity is a destructor examines all sibling members for destructors that will be implicitly invoked by this destructor and adds any such member destructors to the argument symbolArr .
// Am I a destructor? // Find my class and its members (my siblings) // For each data member sibling, check its class for a dtor // member's and member's bases'