gala_clients/DIS_group/src/GROUPswApp.cxx
// Show Transitive Members of selected groups.
Show Transitive Members of selected groups.
Show Transitive Members of selected groups .
vbool GROUPswApp::showTransitiveMembers(const symbolArr sources, symbolArr& results)
{
    Initialize(GROUPswApp::showTransitiveMembers);
    symbolSet memberSet;
    memberSet.insert(results);
    symbolPtr groupSym;
    ForEachS(groupSym, sources) {
        groupHdrPtr group = groupHdr::sym_to_groupHdr(groupSym);
        if (group) {
            symbolArr members;
            group->get_members(members, true);
            symbolArr localMembers;
            group->get_members(localMembers, false);
            symbolSet localSet;
            localSet.insert(localMembers);
            symbolPtr mem;
            ForEachS(mem, members) {
                if (!localSet.includes(mem) && !memberSet.includes(mem) ) {
                    memberSet.insert_last(mem);
                }
             }
        } else {
            dis_message(0, MSG_ERROR, "Symbol '%s' isn't a groupHdr!!!\n",
                    groupSym.get_name() );
        }
    }
    results = memberSet;
    return (vTRUE);
}
vbool GROUPswApp :: showTransitiveMembers ( const symbolArr sources , symbolArr & results ) { Initialize ( GROUPswApp :: showTransitiveMembers ) ; symbolSet memberSet ; memberSet . insert ( results ) ; symbolPtr groupSym ; ForEachS ( groupSym , sources ) { groupHdrPtr group = groupHdr :: sym_to_groupHdr ( groupSym ) ; if ( group ) { symbolArr members ; group -> get_members ( members , true ) ; symbolArr localMembers ; group -> get_members ( localMembers , false ) ; symbolSet localSet ; localSet . insert ( localMembers ) ; symbolPtr mem ; ForEachS ( mem , members ) { if ( ! localSet . includes ( mem ) && ! memberSet . includes ( mem ) ) { memberSet . insert_last ( mem ) ; } } } else { dis_message ( 0 , MSG_ERROR , " \n " , groupSym . get_name ( ) ) ; } } results = memberSet ; return ( vTRUE ) ; }
Show Transitive Members of selected groups.
Show Transitive Members of selected groups .
// This set will hold the transitive members. // Loop through the selected groups, adding all members to the members list. // Get local and transitive members for the group. // Get a set of only local members for the group. // Add the transitive members to the member set. //    (If it isn't in the Local Set and it isn't already in the list.)